| 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/v8.h" | 5 #include "src/v8.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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 AstNodeFactory ast_node_factory(info->ast_value_factory()); | 276 AstNodeFactory ast_node_factory(info->ast_value_factory()); |
| 277 if (!top->AllocateVariables(info, &ast_node_factory)) { | 277 if (!top->AllocateVariables(info, &ast_node_factory)) { |
| 278 DCHECK(top->pending_error_handler_.has_pending_error()); | 278 DCHECK(top->pending_error_handler_.has_pending_error()); |
| 279 top->pending_error_handler_.ThrowPendingError(info->isolate(), | 279 top->pending_error_handler_.ThrowPendingError(info->isolate(), |
| 280 info->script()); | 280 info->script()); |
| 281 return false; | 281 return false; |
| 282 } | 282 } |
| 283 } | 283 } |
| 284 | 284 |
| 285 #ifdef DEBUG | 285 #ifdef DEBUG |
| 286 if (info->isolate()->bootstrapper()->IsActive() | 286 bool native = info->isolate()->bootstrapper()->IsActive(); |
| 287 ? FLAG_print_builtin_scopes | 287 if (!info->shared_info().is_null()) { |
| 288 : FLAG_print_scopes) { | 288 Object* script = info->shared_info()->script(); |
| 289 scope->Print(); | 289 native = script->IsScript() && |
| 290 Script::cast(script)->type()->value() == Script::TYPE_NATIVE; |
| 290 } | 291 } |
| 292 |
| 293 if (native ? FLAG_print_builtin_scopes : FLAG_print_scopes) scope->Print(); |
| 291 #endif | 294 #endif |
| 292 | 295 |
| 293 info->set_scope(scope); | 296 info->set_scope(scope); |
| 294 return true; | 297 return true; |
| 295 } | 298 } |
| 296 | 299 |
| 297 | 300 |
| 298 void Scope::Initialize() { | 301 void Scope::Initialize() { |
| 299 bool subclass_constructor = IsSubclassConstructor(function_kind_); | 302 bool subclass_constructor = IsSubclassConstructor(function_kind_); |
| 300 DCHECK(!already_resolved()); | 303 DCHECK(!already_resolved()); |
| (...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 } | 1567 } |
| 1565 | 1568 |
| 1566 | 1569 |
| 1567 int Scope::ContextLocalCount() const { | 1570 int Scope::ContextLocalCount() const { |
| 1568 if (num_heap_slots() == 0) return 0; | 1571 if (num_heap_slots() == 0) return 0; |
| 1569 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1572 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
| 1570 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); | 1573 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); |
| 1571 } | 1574 } |
| 1572 } // namespace internal | 1575 } // namespace internal |
| 1573 } // namespace v8 | 1576 } // namespace v8 |
| OLD | NEW |