| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 } | 442 } |
| 443 bool IsModuleContext() { | 443 bool IsModuleContext() { |
| 444 Map* map = this->map(); | 444 Map* map = this->map(); |
| 445 return map == map->GetHeap()->module_context_map(); | 445 return map == map->GetHeap()->module_context_map(); |
| 446 } | 446 } |
| 447 bool IsGlobalContext() { | 447 bool IsGlobalContext() { |
| 448 Map* map = this->map(); | 448 Map* map = this->map(); |
| 449 return map == map->GetHeap()->global_context_map(); | 449 return map == map->GetHeap()->global_context_map(); |
| 450 } | 450 } |
| 451 | 451 |
| 452 bool HasSameSecurityTokenAs(Context* that) { |
| 453 return this->global_object()->native_context()->security_token() == |
| 454 that->global_object()->native_context()->security_token(); |
| 455 } |
| 456 |
| 452 // A native context holds a list of all functions with optimized code. | 457 // A native context holds a list of all functions with optimized code. |
| 453 void AddOptimizedFunction(JSFunction* function); | 458 void AddOptimizedFunction(JSFunction* function); |
| 454 void RemoveOptimizedFunction(JSFunction* function); | 459 void RemoveOptimizedFunction(JSFunction* function); |
| 455 void SetOptimizedFunctionsListHead(Object* head); | 460 void SetOptimizedFunctionsListHead(Object* head); |
| 456 Object* OptimizedFunctionsListHead(); | 461 Object* OptimizedFunctionsListHead(); |
| 457 | 462 |
| 458 // The native context also stores a list of all optimized code and a | 463 // The native context also stores a list of all optimized code and a |
| 459 // list of all deoptimized code, which are needed by the deoptimizer. | 464 // list of all deoptimized code, which are needed by the deoptimizer. |
| 460 void AddOptimizedCode(Code* code); | 465 void AddOptimizedCode(Code* code); |
| 461 void SetOptimizedCodeListHead(Object* head); | 466 void SetOptimizedCodeListHead(Object* head); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 545 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); |
| 541 #endif | 546 #endif |
| 542 | 547 |
| 543 STATIC_CHECK(kHeaderSize == Internals::kContextHeaderSize); | 548 STATIC_CHECK(kHeaderSize == Internals::kContextHeaderSize); |
| 544 STATIC_CHECK(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 549 STATIC_CHECK(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
| 545 }; | 550 }; |
| 546 | 551 |
| 547 } } // namespace v8::internal | 552 } } // namespace v8::internal |
| 548 | 553 |
| 549 #endif // V8_CONTEXTS_H_ | 554 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |