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