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 "heap.h" | 8 #include "heap.h" |
9 #include "objects.h" | 9 #include "objects.h" |
10 | 10 |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 } | 432 } |
433 bool IsModuleContext() { | 433 bool IsModuleContext() { |
434 Map* map = this->map(); | 434 Map* map = this->map(); |
435 return map == map->GetHeap()->module_context_map(); | 435 return map == map->GetHeap()->module_context_map(); |
436 } | 436 } |
437 bool IsGlobalContext() { | 437 bool IsGlobalContext() { |
438 Map* map = this->map(); | 438 Map* map = this->map(); |
439 return map == map->GetHeap()->global_context_map(); | 439 return map == map->GetHeap()->global_context_map(); |
440 } | 440 } |
441 | 441 |
| 442 bool HasSameSecurityTokenAs(Context* that) { |
| 443 return this->global_object()->native_context()->security_token() == |
| 444 that->global_object()->native_context()->security_token(); |
| 445 } |
| 446 |
442 // A native context holds a list of all functions with optimized code. | 447 // A native context holds a list of all functions with optimized code. |
443 void AddOptimizedFunction(JSFunction* function); | 448 void AddOptimizedFunction(JSFunction* function); |
444 void RemoveOptimizedFunction(JSFunction* function); | 449 void RemoveOptimizedFunction(JSFunction* function); |
445 void SetOptimizedFunctionsListHead(Object* head); | 450 void SetOptimizedFunctionsListHead(Object* head); |
446 Object* OptimizedFunctionsListHead(); | 451 Object* OptimizedFunctionsListHead(); |
447 | 452 |
448 // The native context also stores a list of all optimized code and a | 453 // The native context also stores a list of all optimized code and a |
449 // list of all deoptimized code, which are needed by the deoptimizer. | 454 // list of all deoptimized code, which are needed by the deoptimizer. |
450 void AddOptimizedCode(Code* code); | 455 void AddOptimizedCode(Code* code); |
451 void SetOptimizedCodeListHead(Object* head); | 456 void SetOptimizedCodeListHead(Object* head); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 535 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); |
531 #endif | 536 #endif |
532 | 537 |
533 STATIC_CHECK(kHeaderSize == Internals::kContextHeaderSize); | 538 STATIC_CHECK(kHeaderSize == Internals::kContextHeaderSize); |
534 STATIC_CHECK(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 539 STATIC_CHECK(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
535 }; | 540 }; |
536 | 541 |
537 } } // namespace v8::internal | 542 } } // namespace v8::internal |
538 | 543 |
539 #endif // V8_CONTEXTS_H_ | 544 #endif // V8_CONTEXTS_H_ |
OLD | NEW |