Chromium Code Reviews| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 V(MAP_ITERATOR_MAP_INDEX, Map, map_iterator_map) \ | 275 V(MAP_ITERATOR_MAP_INDEX, Map, map_iterator_map) \ |
| 276 V(MATH_RANDOM_INDEX_INDEX, Smi, math_random_index) \ | 276 V(MATH_RANDOM_INDEX_INDEX, Smi, math_random_index) \ |
| 277 V(MATH_RANDOM_CACHE_INDEX, Object, math_random_cache) \ | 277 V(MATH_RANDOM_CACHE_INDEX, Object, math_random_cache) \ |
| 278 V(MESSAGE_LISTENERS_INDEX, TemplateList, message_listeners) \ | 278 V(MESSAGE_LISTENERS_INDEX, TemplateList, message_listeners) \ |
| 279 V(NATIVES_UTILS_OBJECT_INDEX, Object, natives_utils_object) \ | 279 V(NATIVES_UTILS_OBJECT_INDEX, Object, natives_utils_object) \ |
| 280 V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache) \ | 280 V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache) \ |
| 281 V(NUMBER_FUNCTION_INDEX, JSFunction, number_function) \ | 281 V(NUMBER_FUNCTION_INDEX, JSFunction, number_function) \ |
| 282 V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \ | 282 V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \ |
| 283 V(OBJECT_FUNCTION_PROTOTYPE_MAP_INDEX, Map, object_function_prototype_map) \ | 283 V(OBJECT_FUNCTION_PROTOTYPE_MAP_INDEX, Map, object_function_prototype_map) \ |
| 284 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ | 284 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ |
| 285 V(OSRD_OPTIMIZED_TABLE_INDEX, FixedArray, osrd_function_table) \ | |
|
Michael Starzinger
2016/12/07 09:26:31
nit: The table stores code, not functions. How wou
mvstanton
2016/12/07 14:42:32
Good idea, thanks.
| |
| 285 V(PROXY_CALLABLE_MAP_INDEX, Map, proxy_callable_map) \ | 286 V(PROXY_CALLABLE_MAP_INDEX, Map, proxy_callable_map) \ |
| 286 V(PROXY_CONSTRUCTOR_MAP_INDEX, Map, proxy_constructor_map) \ | 287 V(PROXY_CONSTRUCTOR_MAP_INDEX, Map, proxy_constructor_map) \ |
| 287 V(PROXY_FUNCTION_INDEX, JSFunction, proxy_function) \ | 288 V(PROXY_FUNCTION_INDEX, JSFunction, proxy_function) \ |
| 288 V(PROXY_FUNCTION_MAP_INDEX, Map, proxy_function_map) \ | 289 V(PROXY_FUNCTION_MAP_INDEX, Map, proxy_function_map) \ |
| 289 V(PROXY_MAP_INDEX, Map, proxy_map) \ | 290 V(PROXY_MAP_INDEX, Map, proxy_map) \ |
| 290 V(PROMISE_RESOLVE_SHARED_FUN, SharedFunctionInfo, \ | 291 V(PROMISE_RESOLVE_SHARED_FUN, SharedFunctionInfo, \ |
| 291 promise_resolve_shared_fun) \ | 292 promise_resolve_shared_fun) \ |
| 292 V(PROMISE_REJECT_SHARED_FUN, SharedFunctionInfo, promise_reject_shared_fun) \ | 293 V(PROMISE_REJECT_SHARED_FUN, SharedFunctionInfo, promise_reject_shared_fun) \ |
| 293 V(REGEXP_EXEC_FUNCTION_INDEX, JSFunction, regexp_exec_function) \ | 294 V(REGEXP_EXEC_FUNCTION_INDEX, JSFunction, regexp_exec_function) \ |
| 294 V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \ | 295 V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \ |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 549 inline bool IsFunctionContext(); | 550 inline bool IsFunctionContext(); |
| 550 inline bool IsCatchContext(); | 551 inline bool IsCatchContext(); |
| 551 inline bool IsWithContext(); | 552 inline bool IsWithContext(); |
| 552 inline bool IsDebugEvaluateContext(); | 553 inline bool IsDebugEvaluateContext(); |
| 553 inline bool IsBlockContext(); | 554 inline bool IsBlockContext(); |
| 554 inline bool IsModuleContext(); | 555 inline bool IsModuleContext(); |
| 555 inline bool IsScriptContext(); | 556 inline bool IsScriptContext(); |
| 556 | 557 |
| 557 inline bool HasSameSecurityTokenAs(Context* that); | 558 inline bool HasSameSecurityTokenAs(Context* that); |
| 558 | 559 |
| 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 | |
| 562 // the entry itself is left in the map in order to proceed sharing literals. | |
| 563 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason); | |
| 564 | |
| 565 // Clear optimized code map. | |
| 566 void ClearOptimizedCodeMap(); | |
| 567 | |
| 568 // A native context keeps track of all osrd optimized functions. | |
| 569 inline bool OptimizedCodeMapIsCleared(); | |
| 570 void SearchOptimizedCodeMap(SharedFunctionInfo* shared, BailoutId osr_ast_id, | |
| 571 Code** pcode, LiteralsArray** pliterals); | |
| 572 int SearchOptimizedCodeMapEntry(SharedFunctionInfo* shared, | |
| 573 BailoutId osr_ast_id); | |
| 574 | |
| 575 static void AddToOptimizedCodeMap(Handle<Context> native_context, | |
| 576 Handle<SharedFunctionInfo> shared, | |
| 577 Handle<Code> code, | |
| 578 Handle<LiteralsArray> literals, | |
| 579 BailoutId osr_ast_id); | |
| 580 | |
| 559 // A native context holds a list of all functions with optimized code. | 581 // A native context holds a list of all functions with optimized code. |
| 560 void AddOptimizedFunction(JSFunction* function); | 582 void AddOptimizedFunction(JSFunction* function); |
| 561 void RemoveOptimizedFunction(JSFunction* function); | 583 void RemoveOptimizedFunction(JSFunction* function); |
| 562 void SetOptimizedFunctionsListHead(Object* head); | 584 void SetOptimizedFunctionsListHead(Object* head); |
| 563 Object* OptimizedFunctionsListHead(); | 585 Object* OptimizedFunctionsListHead(); |
| 564 | 586 |
| 565 // The native context also stores a list of all optimized code and a | 587 // The native context also stores a list of all optimized code and a |
| 566 // list of all deoptimized code, which are needed by the deoptimizer. | 588 // list of all deoptimized code, which are needed by the deoptimizer. |
| 567 void AddOptimizedCode(Code* code); | 589 void AddOptimizedCode(Code* code); |
| 568 void SetOptimizedCodeListHead(Object* head); | 590 void SetOptimizedCodeListHead(Object* head); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 664 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 686 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
| 665 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 687 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
| 666 }; | 688 }; |
| 667 | 689 |
| 668 typedef Context::Field ContextField; | 690 typedef Context::Field ContextField; |
| 669 | 691 |
| 670 } // namespace internal | 692 } // namespace internal |
| 671 } // namespace v8 | 693 } // namespace v8 |
| 672 | 694 |
| 673 #endif // V8_CONTEXTS_H_ | 695 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |