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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 inline Object* next_context_link(); | 381 inline Object* next_context_link(); |
381 | 382 |
382 inline bool has_extension(); | 383 inline bool has_extension(); |
383 inline HeapObject* extension(); | 384 inline HeapObject* extension(); |
384 inline void set_extension(HeapObject* object); | 385 inline void set_extension(HeapObject* object); |
385 JSObject* extension_object(); | 386 JSObject* extension_object(); |
386 JSReceiver* extension_receiver(); | 387 JSReceiver* extension_receiver(); |
387 ScopeInfo* scope_info(); | 388 ScopeInfo* scope_info(); |
388 String* catch_name(); | 389 String* catch_name(); |
389 | 390 |
| 391 // Find the module context (assuming there is one) and return the associated |
| 392 // module object. |
| 393 JSModule* module(); |
| 394 |
390 // Get the context where var declarations will be hoisted to, which | 395 // Get the context where var declarations will be hoisted to, which |
391 // may be the context itself. | 396 // may be the context itself. |
392 Context* declaration_context(); | 397 Context* declaration_context(); |
393 bool is_declaration_context(); | 398 bool is_declaration_context(); |
394 | 399 |
395 // Get the next closure's context on the context chain. | 400 // Get the next closure's context on the context chain. |
396 Context* closure_context(); | 401 Context* closure_context(); |
397 | 402 |
398 // Returns a JSGlobalProxy object or null. | 403 // Returns a JSGlobalProxy object or null. |
399 JSObject* global_proxy(); | 404 JSObject* global_proxy(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 #endif | 532 #endif |
528 | 533 |
529 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 534 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
530 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 535 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
531 }; | 536 }; |
532 | 537 |
533 } // namespace internal | 538 } // namespace internal |
534 } // namespace v8 | 539 } // namespace v8 |
535 | 540 |
536 #endif // V8_CONTEXTS_H_ | 541 #endif // V8_CONTEXTS_H_ |
OLD | NEW |