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_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 6540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6551 k##name, | 6551 k##name, |
6552 FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) | 6552 FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) |
6553 ATOMIC_FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) | 6553 ATOMIC_FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) |
6554 #undef DECLARE_FUNCTION_ID | 6554 #undef DECLARE_FUNCTION_ID |
6555 // Fake id for a special case of Math.pow. Note, it continues the | 6555 // Fake id for a special case of Math.pow. Note, it continues the |
6556 // list of math functions. | 6556 // list of math functions. |
6557 kMathPowHalf | 6557 kMathPowHalf |
6558 }; | 6558 }; |
6559 | 6559 |
6560 | 6560 |
| 6561 // Result of searching in an optimized code map of a SharedFunctionInfo. Note |
| 6562 // that {code == nullptr} indicates that no entry has been found. |
| 6563 struct CodeAndLiterals { |
| 6564 Code* code; // Cached optimized code. |
| 6565 FixedArray* literals; // Cached literals array. |
| 6566 }; |
| 6567 |
| 6568 |
6561 // SharedFunctionInfo describes the JSFunction information that can be | 6569 // SharedFunctionInfo describes the JSFunction information that can be |
6562 // shared by multiple instances of the function. | 6570 // shared by multiple instances of the function. |
6563 class SharedFunctionInfo: public HeapObject { | 6571 class SharedFunctionInfo: public HeapObject { |
6564 public: | 6572 public: |
6565 // [name]: Function name. | 6573 // [name]: Function name. |
6566 DECL_ACCESSORS(name, Object) | 6574 DECL_ACCESSORS(name, Object) |
6567 | 6575 |
6568 // [code]: Function code. | 6576 // [code]: Function code. |
6569 DECL_ACCESSORS(code, Code) | 6577 DECL_ACCESSORS(code, Code) |
6570 inline void ReplaceCode(Code* code); | 6578 inline void ReplaceCode(Code* code); |
6571 | 6579 |
6572 // [optimized_code_map]: Map from native context to optimized code | 6580 // [optimized_code_map]: Map from native context to optimized code |
6573 // and a shared literals array or Smi(0) if none. | 6581 // and a shared literals array or Smi(0) if none. |
6574 DECL_ACCESSORS(optimized_code_map, Object) | 6582 DECL_ACCESSORS(optimized_code_map, Object) |
6575 | 6583 |
6576 // Returns index i of the entry with the specified context and OSR entry. | 6584 // Returns entry from optimized code map for specified context and OSR entry. |
6577 // At position i - 1 is the context, position i the code, and i + 1 the | 6585 // Note that {code == nullptr} indicates no matching entry has been found. |
6578 // literals array. Returns -1 when no matching entry is found. | 6586 CodeAndLiterals SearchOptimizedCodeMap(Context* native_context, |
6579 int SearchOptimizedCodeMap(Context* native_context, BailoutId osr_ast_id); | 6587 BailoutId osr_ast_id); |
6580 | |
6581 // Installs optimized code from the code map on the given closure. The | |
6582 // index has to be consistent with a search result as defined above. | |
6583 FixedArray* GetLiteralsFromOptimizedCodeMap(int index); | |
6584 | |
6585 Code* GetCodeFromOptimizedCodeMap(int index); | |
6586 | 6588 |
6587 // Clear optimized code map. | 6589 // Clear optimized code map. |
6588 void ClearOptimizedCodeMap(); | 6590 void ClearOptimizedCodeMap(); |
6589 | 6591 |
6590 // Removed a specific optimized code object from the optimized code map. | 6592 // Removed a specific optimized code object from the optimized code map. |
6591 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason); | 6593 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason); |
6592 | 6594 |
6593 // Unconditionally clear the type feedback vector (including vector ICs). | 6595 // Unconditionally clear the type feedback vector (including vector ICs). |
6594 void ClearTypeFeedbackInfo(); | 6596 void ClearTypeFeedbackInfo(); |
6595 | 6597 |
(...skipping 4206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10802 } else { | 10804 } else { |
10803 value &= ~(1 << bit_position); | 10805 value &= ~(1 << bit_position); |
10804 } | 10806 } |
10805 return value; | 10807 return value; |
10806 } | 10808 } |
10807 }; | 10809 }; |
10808 | 10810 |
10809 } } // namespace v8::internal | 10811 } } // namespace v8::internal |
10810 | 10812 |
10811 #endif // V8_OBJECTS_H_ | 10813 #endif // V8_OBJECTS_H_ |
OLD | NEW |