| Index: src/scopes.cc
|
| diff --git a/src/scopes.cc b/src/scopes.cc
|
| index 0dfc3a2c426f4a917823cbf13a677940509e1dd0..fe78811b4c35f1a2847353898352076bcbbcdb2b 100644
|
| --- a/src/scopes.cc
|
| +++ b/src/scopes.cc
|
| @@ -270,6 +270,9 @@ bool Scope::Analyze(CompilationInfo* info) {
|
| !top->outer_scope()->already_resolved()) {
|
| top = top->outer_scope();
|
| }
|
| + // TODO(rossberg): remove the above.
|
| + top = info->global_scope();
|
| + ASSERT(top->is_global_scope());
|
|
|
| // Allocate the variables.
|
| {
|
| @@ -773,6 +776,7 @@ static const char* Header(ScopeType scope_type) {
|
| case FUNCTION_SCOPE: return "function";
|
| case MODULE_SCOPE: return "module";
|
| case GLOBAL_SCOPE: return "global";
|
| + case SCRIPT_SCOPE: return "script";
|
| case CATCH_SCOPE: return "catch";
|
| case BLOCK_SCOPE: return "block";
|
| case WITH_SCOPE: return "with";
|
| @@ -1223,11 +1227,15 @@ bool Scope::HasArgumentsParameter() {
|
|
|
|
|
| void Scope::AllocateStackSlot(Variable* var) {
|
| + ASSERT(var->scope() == this);
|
| var->AllocateTo(Variable::LOCAL, num_stack_slots_++);
|
| }
|
|
|
|
|
| void Scope::AllocateHeapSlot(Variable* var) {
|
| +printf("[AllocateHeapSlot] scope=%p %s var=%.*s\n", (void*)this, Variable::Mode2String(var->mode()), var->raw_name()->length(), var->raw_name()->raw_data());
|
| +if (var->mode() == LET) base::OS::DebugBreak();
|
| + ASSERT(var->scope() == this);
|
| var->AllocateTo(Variable::CONTEXT, num_heap_slots_++);
|
| }
|
|
|
|
|