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