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