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 #ifndef V8_CONTEXTS_H_ | 5 #ifndef V8_CONTEXTS_H_ |
6 #define V8_CONTEXTS_H_ | 6 #define V8_CONTEXTS_H_ |
7 | 7 |
8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 | 10 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \ | 220 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \ |
221 V(TYPED_ARRAY_FUN_INDEX, JSFunction, typed_array_function) \ | 221 V(TYPED_ARRAY_FUN_INDEX, JSFunction, typed_array_function) \ |
222 V(TYPED_ARRAY_PROTOTYPE_INDEX, JSObject, typed_array_prototype) \ | 222 V(TYPED_ARRAY_PROTOTYPE_INDEX, JSObject, typed_array_prototype) \ |
223 V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun) \ | 223 V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun) \ |
224 V(UINT16X8_FUNCTION_INDEX, JSFunction, uint16x8_function) \ | 224 V(UINT16X8_FUNCTION_INDEX, JSFunction, uint16x8_function) \ |
225 V(UINT32_ARRAY_FUN_INDEX, JSFunction, uint32_array_fun) \ | 225 V(UINT32_ARRAY_FUN_INDEX, JSFunction, uint32_array_fun) \ |
226 V(UINT32X4_FUNCTION_INDEX, JSFunction, uint32x4_function) \ | 226 V(UINT32X4_FUNCTION_INDEX, JSFunction, uint32x4_function) \ |
227 V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun) \ | 227 V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun) \ |
228 V(UINT8_CLAMPED_ARRAY_FUN_INDEX, JSFunction, uint8_clamped_array_fun) \ | 228 V(UINT8_CLAMPED_ARRAY_FUN_INDEX, JSFunction, uint8_clamped_array_fun) \ |
229 V(UINT8X16_FUNCTION_INDEX, JSFunction, uint8x16_function) \ | 229 V(UINT8X16_FUNCTION_INDEX, JSFunction, uint8x16_function) \ |
| 230 V(CURRENT_MODULE_INDEX, JSModule, current_module) \ |
230 NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V) \ | 231 NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V) \ |
231 NATIVE_CONTEXT_IMPORTED_FIELDS(V) | 232 NATIVE_CONTEXT_IMPORTED_FIELDS(V) |
232 | 233 |
233 // A table of all script contexts. Every loaded top-level script with top-level | 234 // A table of all script contexts. Every loaded top-level script with top-level |
234 // lexical declarations contributes its ScriptContext into this table. | 235 // lexical declarations contributes its ScriptContext into this table. |
235 // | 236 // |
236 // The table is a fixed array, its first slot is the current used count and | 237 // The table is a fixed array, its first slot is the current used count and |
237 // the subsequent slots 1..used contain ScriptContexts. | 238 // the subsequent slots 1..used contain ScriptContexts. |
238 class ScriptContextTable : public FixedArray { | 239 class ScriptContextTable : public FixedArray { |
239 public: | 240 public: |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 inline Object* next_context_link(); | 392 inline Object* next_context_link(); |
392 | 393 |
393 inline bool has_extension(); | 394 inline bool has_extension(); |
394 inline HeapObject* extension(); | 395 inline HeapObject* extension(); |
395 inline void set_extension(HeapObject* object); | 396 inline void set_extension(HeapObject* object); |
396 JSObject* extension_object(); | 397 JSObject* extension_object(); |
397 JSReceiver* extension_receiver(); | 398 JSReceiver* extension_receiver(); |
398 ScopeInfo* scope_info(); | 399 ScopeInfo* scope_info(); |
399 String* catch_name(); | 400 String* catch_name(); |
400 | 401 |
| 402 // Find the module context (assuming there is one) and return the associated |
| 403 // module object. |
| 404 JSModule* module(); |
| 405 |
401 // Get the context where var declarations will be hoisted to, which | 406 // Get the context where var declarations will be hoisted to, which |
402 // may be the context itself. | 407 // may be the context itself. |
403 Context* declaration_context(); | 408 Context* declaration_context(); |
404 bool is_declaration_context(); | 409 bool is_declaration_context(); |
405 | 410 |
406 // Get the next closure's context on the context chain. | 411 // Get the next closure's context on the context chain. |
407 Context* closure_context(); | 412 Context* closure_context(); |
408 | 413 |
409 // Returns a JSGlobalProxy object or null. | 414 // Returns a JSGlobalProxy object or null. |
410 JSObject* global_proxy(); | 415 JSObject* global_proxy(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 #endif | 543 #endif |
539 | 544 |
540 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 545 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
541 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 546 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
542 }; | 547 }; |
543 | 548 |
544 } // namespace internal | 549 } // namespace internal |
545 } // namespace v8 | 550 } // namespace v8 |
546 | 551 |
547 #endif // V8_CONTEXTS_H_ | 552 #endif // V8_CONTEXTS_H_ |
OLD | NEW |