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 15 matching lines...) Loading... |
26 | 26 |
27 void ScriptContextTable::set_used(int used) { | 27 void ScriptContextTable::set_used(int used) { |
28 set(kUsedSlot, Smi::FromInt(used)); | 28 set(kUsedSlot, Smi::FromInt(used)); |
29 } | 29 } |
30 | 30 |
31 | 31 |
32 // static | 32 // static |
33 Handle<Context> ScriptContextTable::GetContext(Handle<ScriptContextTable> table, | 33 Handle<Context> ScriptContextTable::GetContext(Handle<ScriptContextTable> table, |
34 int i) { | 34 int i) { |
35 DCHECK(i < table->used()); | 35 DCHECK(i < table->used()); |
36 return Handle<Context>::cast(FixedArray::get(table, i + kFirstContextSlot)); | 36 return Handle<Context>::cast( |
| 37 FixedArray::get(*table, i + kFirstContextSlot, table->GetIsolate())); |
37 } | 38 } |
38 | 39 |
39 | 40 |
40 // static | 41 // static |
41 Context* Context::cast(Object* context) { | 42 Context* Context::cast(Object* context) { |
42 DCHECK(context->IsContext()); | 43 DCHECK(context->IsContext()); |
43 return reinterpret_cast<Context*>(context); | 44 return reinterpret_cast<Context*>(context); |
44 } | 45 } |
45 | 46 |
46 | 47 |
(...skipping 96 matching lines...) Loading... |
143 return type::cast(get(index)); \ | 144 return type::cast(get(index)); \ |
144 } | 145 } |
145 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS) | 146 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS) |
146 #undef NATIVE_CONTEXT_FIELD_ACCESSORS | 147 #undef NATIVE_CONTEXT_FIELD_ACCESSORS |
147 | 148 |
148 | 149 |
149 } // namespace internal | 150 } // namespace internal |
150 } // namespace v8 | 151 } // namespace v8 |
151 | 152 |
152 #endif // V8_CONTEXTS_INL_H_ | 153 #endif // V8_CONTEXTS_INL_H_ |
OLD | NEW |