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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 NEXT_CONTEXT_LINK, // Weak. | 398 NEXT_CONTEXT_LINK, // Weak. |
399 | 399 |
400 // Total number of slots. | 400 // Total number of slots. |
401 NATIVE_CONTEXT_SLOTS, | 401 NATIVE_CONTEXT_SLOTS, |
402 FIRST_WEAK_SLOT = OPTIMIZED_FUNCTIONS_LIST, | 402 FIRST_WEAK_SLOT = OPTIMIZED_FUNCTIONS_LIST, |
403 FIRST_JS_ARRAY_MAP_SLOT = JS_ARRAY_FAST_SMI_ELEMENTS_MAP_INDEX, | 403 FIRST_JS_ARRAY_MAP_SLOT = JS_ARRAY_FAST_SMI_ELEMENTS_MAP_INDEX, |
404 | 404 |
405 MIN_CONTEXT_SLOTS = GLOBAL_PROXY_INDEX, | 405 MIN_CONTEXT_SLOTS = GLOBAL_PROXY_INDEX, |
406 // This slot holds the thrown value in catch contexts. | 406 // This slot holds the thrown value in catch contexts. |
407 THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS, | 407 THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS, |
| 408 |
| 409 // These slots hold values in debug evaluate contexts. |
| 410 WRAPPED_CONTEXT_INDEX = MIN_CONTEXT_SLOTS, |
| 411 WHITE_LIST_INDEX = MIN_CONTEXT_SLOTS + 1 |
408 }; | 412 }; |
409 | 413 |
410 void IncrementErrorsThrown(); | 414 void IncrementErrorsThrown(); |
411 int GetErrorsThrown(); | 415 int GetErrorsThrown(); |
412 | 416 |
413 // Direct slot access. | 417 // Direct slot access. |
414 inline JSFunction* closure(); | 418 inline JSFunction* closure(); |
415 inline void set_closure(JSFunction* closure); | 419 inline void set_closure(JSFunction* closure); |
416 | 420 |
417 inline Context* previous(); | 421 inline Context* previous(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 inline Context* native_context(); | 454 inline Context* native_context(); |
451 inline void set_native_context(Context* context); | 455 inline void set_native_context(Context* context); |
452 | 456 |
453 // Predicates for context types. IsNativeContext is also defined on Object | 457 // Predicates for context types. IsNativeContext is also defined on Object |
454 // because we frequently have to know if arbitrary objects are natives | 458 // because we frequently have to know if arbitrary objects are natives |
455 // contexts. | 459 // contexts. |
456 inline bool IsNativeContext(); | 460 inline bool IsNativeContext(); |
457 inline bool IsFunctionContext(); | 461 inline bool IsFunctionContext(); |
458 inline bool IsCatchContext(); | 462 inline bool IsCatchContext(); |
459 inline bool IsWithContext(); | 463 inline bool IsWithContext(); |
| 464 inline bool IsDebugEvaluateContext(); |
460 inline bool IsBlockContext(); | 465 inline bool IsBlockContext(); |
461 inline bool IsModuleContext(); | 466 inline bool IsModuleContext(); |
462 inline bool IsScriptContext(); | 467 inline bool IsScriptContext(); |
463 | 468 |
464 inline bool HasSameSecurityTokenAs(Context* that); | 469 inline bool HasSameSecurityTokenAs(Context* that); |
465 | 470 |
466 // Initializes global variable bindings in given script context. | 471 // Initializes global variable bindings in given script context. |
467 void InitializeGlobalSlots(); | 472 void InitializeGlobalSlots(); |
468 | 473 |
469 // A native context holds a list of all functions with optimized code. | 474 // A native context holds a list of all functions with optimized code. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 #endif | 570 #endif |
566 | 571 |
567 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 572 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
568 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 573 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
569 }; | 574 }; |
570 | 575 |
571 } // namespace internal | 576 } // namespace internal |
572 } // namespace v8 | 577 } // namespace v8 |
573 | 578 |
574 #endif // V8_CONTEXTS_H_ | 579 #endif // V8_CONTEXTS_H_ |
OLD | NEW |