| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_CONTEXTS_INL_H_ | 5 #ifndef V8_CONTEXTS_INL_H_ |
| 6 #define V8_CONTEXTS_INL_H_ | 6 #define V8_CONTEXTS_INL_H_ |
| 7 | 7 |
| 8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
| 9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 bool Context::has_extension() { return !extension()->IsTheHole(GetIsolate()); } | 61 bool Context::has_extension() { return !extension()->IsTheHole(GetIsolate()); } |
| 62 HeapObject* Context::extension() { | 62 HeapObject* Context::extension() { |
| 63 return HeapObject::cast(get(EXTENSION_INDEX)); | 63 return HeapObject::cast(get(EXTENSION_INDEX)); |
| 64 } | 64 } |
| 65 void Context::set_extension(HeapObject* object) { | 65 void Context::set_extension(HeapObject* object) { |
| 66 set(EXTENSION_INDEX, object); | 66 set(EXTENSION_INDEX, object); |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 JSModule* Context::module() { return JSModule::cast(get(EXTENSION_INDEX)); } | |
| 71 void Context::set_module(JSModule* module) { set(EXTENSION_INDEX, module); } | |
| 72 | |
| 73 | |
| 74 Context* Context::native_context() { | 70 Context* Context::native_context() { |
| 75 Object* result = get(NATIVE_CONTEXT_INDEX); | 71 Object* result = get(NATIVE_CONTEXT_INDEX); |
| 76 DCHECK(IsBootstrappingOrNativeContext(this->GetIsolate(), result)); | 72 DCHECK(IsBootstrappingOrNativeContext(this->GetIsolate(), result)); |
| 77 return reinterpret_cast<Context*>(result); | 73 return reinterpret_cast<Context*>(result); |
| 78 } | 74 } |
| 79 | 75 |
| 80 | 76 |
| 81 void Context::set_native_context(Context* context) { | 77 void Context::set_native_context(Context* context) { |
| 82 set(NATIVE_CONTEXT_INDEX, context); | 78 set(NATIVE_CONTEXT_INDEX, context); |
| 83 } | 79 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 return type::cast(get(index)); \ | 145 return type::cast(get(index)); \ |
| 150 } | 146 } |
| 151 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS) | 147 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS) |
| 152 #undef NATIVE_CONTEXT_FIELD_ACCESSORS | 148 #undef NATIVE_CONTEXT_FIELD_ACCESSORS |
| 153 | 149 |
| 154 | 150 |
| 155 } // namespace internal | 151 } // namespace internal |
| 156 } // namespace v8 | 152 } // namespace v8 |
| 157 | 153 |
| 158 #endif // V8_CONTEXTS_INL_H_ | 154 #endif // V8_CONTEXTS_INL_H_ |
| OLD | NEW |