OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/scopes.h" | 5 #include "src/scopes.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/messages.h" | 9 #include "src/messages.h" |
10 #include "src/parser.h" | 10 #include "src/parser.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 info->script()); | 306 info->script()); |
307 return false; | 307 return false; |
308 } | 308 } |
309 } | 309 } |
310 | 310 |
311 #ifdef DEBUG | 311 #ifdef DEBUG |
312 bool native = info->isolate()->bootstrapper()->IsActive(); | 312 bool native = info->isolate()->bootstrapper()->IsActive(); |
313 if (!info->shared_info().is_null()) { | 313 if (!info->shared_info().is_null()) { |
314 Object* script = info->shared_info()->script(); | 314 Object* script = info->shared_info()->script(); |
315 native = script->IsScript() && | 315 native = script->IsScript() && |
316 Script::cast(script)->type()->value() == Script::TYPE_NATIVE; | 316 Script::cast(script)->type() == Script::TYPE_NATIVE; |
317 } | 317 } |
318 | 318 |
319 if (native ? FLAG_print_builtin_scopes : FLAG_print_scopes) scope->Print(); | 319 if (native ? FLAG_print_builtin_scopes : FLAG_print_scopes) scope->Print(); |
320 #endif | 320 #endif |
321 | 321 |
322 info->set_scope(scope); | 322 info->set_scope(scope); |
323 return true; | 323 return true; |
324 } | 324 } |
325 | 325 |
326 | 326 |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1649 function_ != NULL && function_->proxy()->var()->IsContextSlot(); | 1649 function_ != NULL && function_->proxy()->var()->IsContextSlot(); |
1650 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - | 1650 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - |
1651 (is_function_var_in_context ? 1 : 0); | 1651 (is_function_var_in_context ? 1 : 0); |
1652 } | 1652 } |
1653 | 1653 |
1654 | 1654 |
1655 int Scope::ContextGlobalCount() const { return num_global_slots(); } | 1655 int Scope::ContextGlobalCount() const { return num_global_slots(); } |
1656 | 1656 |
1657 } // namespace internal | 1657 } // namespace internal |
1658 } // namespace v8 | 1658 } // namespace v8 |
OLD | NEW |