Bug 1254164 - Make aliasedBodyLevelLexicalBegin a uint32. r=Waldo, a=lizzard

This commit is contained in:
Shu-yu Guo 2016-03-18 15:07:27 -07:00
parent 3dadaea877
commit fb146a9a7c
3 changed files with 16 additions and 3 deletions

View File

@ -0,0 +1,6 @@
// |jit-test| slow;
var s = '';
for (var i = 0; i < 70000; i++)
s += 'function x' + i + '() { x' + i + '(); }\n';
eval("(function() { " + s + " })();");

View File

@ -131,7 +131,10 @@ Bindings::initWithTemporaryStorage(ExclusiveContext* cx, MutableHandle<Bindings>
// any time, such accesses are mediated by DebugScopeProxy (see
// DebugScopeProxy::handleUnaliasedAccess).
uint32_t nslots = CallObject::RESERVED_SLOTS;
uint32_t aliasedBodyLevelLexicalBegin = UINT16_MAX;
// Unless there are aliased body-level lexical bindings at all, set the
// begin index to an impossible slot number.
uint32_t aliasedBodyLevelLexicalBegin = LOCALNO_LIMIT;
for (BindingIter bi(self); bi; bi++) {
if (bi->aliased()) {
// Per ES6, lexical bindings cannot be accessed until

View File

@ -228,8 +228,8 @@ class Bindings
uint16_t numArgs_;
uint16_t numBlockScoped_;
uint16_t numBodyLevelLexicals_;
uint16_t aliasedBodyLevelLexicalBegin_;
uint16_t numUnaliasedBodyLevelLexicals_;
uint32_t aliasedBodyLevelLexicalBegin_;
uint32_t numVars_;
uint32_t numUnaliasedVars_;
@ -356,6 +356,10 @@ class Bindings
void trace(JSTracer* trc);
};
// If this fails, add/remove padding within Bindings.
static_assert(sizeof(Bindings) % js::gc::CellSize == 0,
"Size of Bindings must be an integral multiple of js::gc::CellSize");
template <class Outer>
class BindingsOperations
{
@ -438,7 +442,7 @@ class MutableBindingsOperations : public BindingsOperations<Outer>
void setNumUnaliasedBodyLevelLexicals(uint16_t num) {
bindings().numUnaliasedBodyLevelLexicals_ = num;
}
void setAliasedBodyLevelLexicalBegin(uint16_t offset) {
void setAliasedBodyLevelLexicalBegin(uint32_t offset) {
bindings().aliasedBodyLevelLexicalBegin_ = offset;
}
uint8_t* switchToScriptStorage(Binding* permanentStorage) {