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