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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 // Removes a specific optimized code object from the optimized code map. | 560 // Removes a specific optimized code object from the optimized code map. |
561 // In case of non-OSR the code reference is cleared from the cache entry but | 561 // In case of non-OSR the code reference is cleared from the cache entry but |
562 // the entry itself is left in the map in order to proceed sharing literals. | 562 // the entry itself is left in the map in order to proceed sharing literals. |
563 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason); | 563 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason); |
564 | 564 |
565 // Clear optimized code map. | 565 // Clear optimized code map. |
566 void ClearOptimizedCodeMap(); | 566 void ClearOptimizedCodeMap(); |
567 | 567 |
568 // A native context keeps track of all osrd optimized functions. | 568 // A native context keeps track of all osrd optimized functions. |
569 inline bool OptimizedCodeMapIsCleared(); | 569 inline bool OptimizedCodeMapIsCleared(); |
570 void SearchOptimizedCodeMap(SharedFunctionInfo* shared, BailoutId osr_ast_id, | 570 Code* SearchOptimizedCodeMap(SharedFunctionInfo* shared, |
571 Code** pcode, LiteralsArray** pliterals); | 571 BailoutId osr_ast_id); |
572 int SearchOptimizedCodeMapEntry(SharedFunctionInfo* shared, | 572 int SearchOptimizedCodeMapEntry(SharedFunctionInfo* shared, |
573 BailoutId osr_ast_id); | 573 BailoutId osr_ast_id); |
574 | 574 |
575 static void AddToOptimizedCodeMap(Handle<Context> native_context, | 575 static void AddToOptimizedCodeMap(Handle<Context> native_context, |
576 Handle<SharedFunctionInfo> shared, | 576 Handle<SharedFunctionInfo> shared, |
577 Handle<Code> code, | 577 Handle<Code> code, |
578 Handle<LiteralsArray> literals, | |
579 BailoutId osr_ast_id); | 578 BailoutId osr_ast_id); |
580 | 579 |
581 // A native context holds a list of all functions with optimized code. | 580 // A native context holds a list of all functions with optimized code. |
582 void AddOptimizedFunction(JSFunction* function); | 581 void AddOptimizedFunction(JSFunction* function); |
583 void RemoveOptimizedFunction(JSFunction* function); | 582 void RemoveOptimizedFunction(JSFunction* function); |
584 void SetOptimizedFunctionsListHead(Object* head); | 583 void SetOptimizedFunctionsListHead(Object* head); |
585 Object* OptimizedFunctionsListHead(); | 584 Object* OptimizedFunctionsListHead(); |
586 | 585 |
587 // The native context also stores a list of all optimized code and a | 586 // The native context also stores a list of all optimized code and a |
588 // list of all deoptimized code, which are needed by the deoptimizer. | 587 // list of all deoptimized code, which are needed by the deoptimizer. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 685 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
687 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 686 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
688 }; | 687 }; |
689 | 688 |
690 typedef Context::Field ContextField; | 689 typedef Context::Field ContextField; |
691 | 690 |
692 } // namespace internal | 691 } // namespace internal |
693 } // namespace v8 | 692 } // namespace v8 |
694 | 693 |
695 #endif // V8_CONTEXTS_H_ | 694 #endif // V8_CONTEXTS_H_ |
OLD | NEW |