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 6501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6512 class SharedFunctionInfo: public HeapObject { | 6512 class SharedFunctionInfo: public HeapObject { |
6513 public: | 6513 public: |
6514 // [name]: Function name. | 6514 // [name]: Function name. |
6515 DECL_ACCESSORS(name, Object) | 6515 DECL_ACCESSORS(name, Object) |
6516 | 6516 |
6517 // [code]: Function code. | 6517 // [code]: Function code. |
6518 DECL_ACCESSORS(code, Code) | 6518 DECL_ACCESSORS(code, Code) |
6519 inline void ReplaceCode(Code* code); | 6519 inline void ReplaceCode(Code* code); |
6520 | 6520 |
6521 // [optimized_code_map]: Map from native context to optimized code | 6521 // [optimized_code_map]: Map from native context to optimized code |
6522 // and a shared literals array or Smi(0) if none. | 6522 // and a shared literals array. |
6523 DECL_ACCESSORS(optimized_code_map, Object) | 6523 DECL_ACCESSORS(optimized_code_map, FixedArray) |
6524 | 6524 |
6525 // Returns entry from optimized code map for specified context and OSR entry. | 6525 // Returns entry from optimized code map for specified context and OSR entry. |
6526 // Note that {code == nullptr, literals == nullptr} indicates no matching | 6526 // Note that {code == nullptr, literals == nullptr} indicates no matching |
6527 // entry has been found, whereas {code, literals == nullptr} indicates that | 6527 // entry has been found, whereas {code, literals == nullptr} indicates that |
6528 // code is context-independent. | 6528 // code is context-independent. |
6529 CodeAndLiterals SearchOptimizedCodeMap(Context* native_context, | 6529 CodeAndLiterals SearchOptimizedCodeMap(Context* native_context, |
6530 BailoutId osr_ast_id); | 6530 BailoutId osr_ast_id); |
6531 | 6531 |
6532 // Clear optimized code map. | 6532 // Clear optimized code map. |
6533 void ClearOptimizedCodeMap(); | 6533 void ClearOptimizedCodeMap(); |
(...skipping 17 matching lines...) Expand all Loading... | |
6551 Handle<Context> native_context, | 6551 Handle<Context> native_context, |
6552 Handle<HeapObject> code, | 6552 Handle<HeapObject> code, |
6553 Handle<LiteralsArray> literals, | 6553 Handle<LiteralsArray> literals, |
6554 BailoutId osr_ast_id); | 6554 BailoutId osr_ast_id); |
6555 | 6555 |
6556 // Set up the link between shared function info and the script. The shared | 6556 // Set up the link between shared function info and the script. The shared |
6557 // function info is added to the list on the script. | 6557 // function info is added to the list on the script. |
6558 static void SetScript(Handle<SharedFunctionInfo> shared, | 6558 static void SetScript(Handle<SharedFunctionInfo> shared, |
6559 Handle<Object> script_object); | 6559 Handle<Object> script_object); |
6560 | 6560 |
6561 inline bool OptimizedCodeMapIsCleared() const; | |
Michael Starzinger
2015/11/13 12:14:22
nit: Needs a comment explaining the nature of the
mvstanton
2015/11/17 20:32:12
Done.
| |
6562 | |
6561 // Layout description of the optimized code map. | 6563 // Layout description of the optimized code map. |
6562 static const int kSharedCodeIndex = 0; | 6564 static const int kSharedCodeIndex = 0; |
6563 static const int kEntriesStart = 1; | 6565 static const int kEntriesStart = 1; |
6564 static const int kContextOffset = 0; | 6566 static const int kContextOffset = 0; |
6565 static const int kCachedCodeOffset = 1; | 6567 static const int kCachedCodeOffset = 1; |
6566 static const int kLiteralsOffset = 2; | 6568 static const int kLiteralsOffset = 2; |
6567 static const int kOsrAstIdOffset = 3; | 6569 static const int kOsrAstIdOffset = 3; |
6568 static const int kEntryLength = 4; | 6570 static const int kEntryLength = 4; |
6569 static const int kInitialLength = kEntriesStart + kEntryLength; | 6571 static const int kInitialLength = kEntriesStart + kEntryLength; |
6570 | 6572 |
(...skipping 4192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10763 } | 10765 } |
10764 return value; | 10766 return value; |
10765 } | 10767 } |
10766 }; | 10768 }; |
10767 | 10769 |
10768 | 10770 |
10769 } // NOLINT, false-positive due to second-order macros. | 10771 } // NOLINT, false-positive due to second-order macros. |
10770 } // NOLINT, false-positive due to second-order macros. | 10772 } // NOLINT, false-positive due to second-order macros. |
10771 | 10773 |
10772 #endif // V8_OBJECTS_H_ | 10774 #endif // V8_OBJECTS_H_ |
OLD | NEW |