| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/contexts.h" | 5 #include "src/contexts.h" |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 10 #include "src/scopeinfo.h" | 10 #include "src/scopeinfo.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 return ScopeInfo::cast(object); | 111 return ScopeInfo::cast(object); |
| 112 } | 112 } |
| 113 | 113 |
| 114 | 114 |
| 115 String* Context::catch_name() { | 115 String* Context::catch_name() { |
| 116 DCHECK(IsCatchContext()); | 116 DCHECK(IsCatchContext()); |
| 117 return String::cast(extension()); | 117 return String::cast(extension()); |
| 118 } | 118 } |
| 119 | 119 |
| 120 | 120 |
| 121 JSBuiltinsObject* Context::builtins() { | |
| 122 GlobalObject* object = global_object(); | |
| 123 if (object->IsJSGlobalObject()) { | |
| 124 return JSGlobalObject::cast(object)->builtins(); | |
| 125 } else { | |
| 126 DCHECK(object->IsJSBuiltinsObject()); | |
| 127 return JSBuiltinsObject::cast(object); | |
| 128 } | |
| 129 } | |
| 130 | |
| 131 | |
| 132 Context* Context::script_context() { | 121 Context* Context::script_context() { |
| 133 Context* current = this; | 122 Context* current = this; |
| 134 while (!current->IsScriptContext()) { | 123 while (!current->IsScriptContext()) { |
| 135 current = current->previous(); | 124 current = current->previous(); |
| 136 } | 125 } |
| 137 return current; | 126 return current; |
| 138 } | 127 } |
| 139 | 128 |
| 140 | 129 |
| 141 Context* Context::native_context() { | 130 Context* Context::native_context() { |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 // During bootstrapping we allow all objects to pass as global | 573 // During bootstrapping we allow all objects to pass as global |
| 585 // objects. This is necessary to fix circular dependencies. | 574 // objects. This is necessary to fix circular dependencies. |
| 586 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 575 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
| 587 isolate->bootstrapper()->IsActive() || | 576 isolate->bootstrapper()->IsActive() || |
| 588 object->IsGlobalObject(); | 577 object->IsGlobalObject(); |
| 589 } | 578 } |
| 590 #endif | 579 #endif |
| 591 | 580 |
| 592 } // namespace internal | 581 } // namespace internal |
| 593 } // namespace v8 | 582 } // namespace v8 |
| OLD | NEW |