| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 5339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5350 DECLARE_PRINTER(Code) | 5350 DECLARE_PRINTER(Code) |
| 5351 DECLARE_VERIFIER(Code) | 5351 DECLARE_VERIFIER(Code) |
| 5352 | 5352 |
| 5353 void ClearInlineCaches(); | 5353 void ClearInlineCaches(); |
| 5354 void ClearInlineCaches(Kind kind); | 5354 void ClearInlineCaches(Kind kind); |
| 5355 | 5355 |
| 5356 void ClearTypeFeedbackCells(Heap* heap); | 5356 void ClearTypeFeedbackCells(Heap* heap); |
| 5357 | 5357 |
| 5358 BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset); | 5358 BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset); |
| 5359 | 5359 |
| 5360 BailoutId OsrAstId(); |
| 5361 |
| 5360 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, | 5362 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, |
| 5361 enum Age { | 5363 enum Age { |
| 5362 kNotExecutedCodeAge = -2, | 5364 kNotExecutedCodeAge = -2, |
| 5363 kExecutedOnceCodeAge = -1, | 5365 kExecutedOnceCodeAge = -1, |
| 5364 kNoAgeCodeAge = 0, | 5366 kNoAgeCodeAge = 0, |
| 5365 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) | 5367 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) |
| 5366 kAfterLastCodeAge, | 5368 kAfterLastCodeAge, |
| 5367 kFirstCodeAge = kNotExecutedCodeAge, | 5369 kFirstCodeAge = kNotExecutedCodeAge, |
| 5368 kLastCodeAge = kAfterLastCodeAge - 1, | 5370 kLastCodeAge = kAfterLastCodeAge - 1, |
| 5369 kCodeAgeCount = kAfterLastCodeAge - kNotExecutedCodeAge - 1, | 5371 kCodeAgeCount = kAfterLastCodeAge - kNotExecutedCodeAge - 1, |
| (...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6530 DECL_ACCESSORS(code, Code) | 6532 DECL_ACCESSORS(code, Code) |
| 6531 inline void ReplaceCode(Code* code); | 6533 inline void ReplaceCode(Code* code); |
| 6532 | 6534 |
| 6533 // [optimized_code_map]: Map from native context to optimized code | 6535 // [optimized_code_map]: Map from native context to optimized code |
| 6534 // and a shared literals array or Smi(0) if none. | 6536 // and a shared literals array or Smi(0) if none. |
| 6535 DECL_ACCESSORS(optimized_code_map, Object) | 6537 DECL_ACCESSORS(optimized_code_map, Object) |
| 6536 | 6538 |
| 6537 // Returns index i of the entry with the specified context. At position | 6539 // Returns index i of the entry with the specified context. At position |
| 6538 // i - 1 is the context, position i the code, and i + 1 the literals array. | 6540 // i - 1 is the context, position i the code, and i + 1 the literals array. |
| 6539 // Returns -1 when no matching entry is found. | 6541 // Returns -1 when no matching entry is found. |
| 6540 int SearchOptimizedCodeMap(Context* native_context); | 6542 int SearchOptimizedCodeMap(Context* native_context, BailoutId osr_ast_id); |
| 6541 | 6543 |
| 6542 // Installs optimized code from the code map on the given closure. The | 6544 // Installs optimized code from the code map on the given closure. The |
| 6543 // index has to be consistent with a search result as defined above. | 6545 // index has to be consistent with a search result as defined above. |
| 6544 void InstallFromOptimizedCodeMap(JSFunction* function, int index); | 6546 void InstallFromOptimizedCodeMap(JSFunction* function, int index); |
| 6545 | 6547 |
| 6546 // Clear optimized code map. | 6548 // Clear optimized code map. |
| 6547 void ClearOptimizedCodeMap(); | 6549 void ClearOptimizedCodeMap(); |
| 6548 | 6550 |
| 6549 // Removed a specific optimized code object from the optimized code map. | 6551 // Removed a specific optimized code object from the optimized code map. |
| 6550 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason); | 6552 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason); |
| 6551 | 6553 |
| 6552 // Trims the optimized code map after entries have been removed. | 6554 // Trims the optimized code map after entries have been removed. |
| 6553 void TrimOptimizedCodeMap(int shrink_by); | 6555 void TrimOptimizedCodeMap(int shrink_by); |
| 6554 | 6556 |
| 6555 // Add a new entry to the optimized code map. | 6557 // Add a new entry to the optimized code map. |
| 6556 MUST_USE_RESULT MaybeObject* AddToOptimizedCodeMap(Context* native_context, | 6558 MUST_USE_RESULT MaybeObject* AddToOptimizedCodeMap(Context* native_context, |
| 6557 Code* code, | 6559 Code* code, |
| 6558 FixedArray* literals); | 6560 FixedArray* literals, |
| 6561 BailoutId osr_ast_id); |
| 6559 static void AddToOptimizedCodeMap(Handle<SharedFunctionInfo> shared, | 6562 static void AddToOptimizedCodeMap(Handle<SharedFunctionInfo> shared, |
| 6560 Handle<Context> native_context, | 6563 Handle<Context> native_context, |
| 6561 Handle<Code> code, | 6564 Handle<Code> code, |
| 6562 Handle<FixedArray> literals); | 6565 Handle<FixedArray> literals, |
| 6566 BailoutId osr_ast_id); |
| 6563 | 6567 |
| 6564 // Layout description of the optimized code map. | 6568 // Layout description of the optimized code map. |
| 6565 static const int kNextMapIndex = 0; | 6569 static const int kNextMapIndex = 0; |
| 6566 static const int kEntriesStart = 1; | 6570 static const int kEntriesStart = 1; |
| 6567 static const int kEntryLength = 3; | 6571 static const int kEntryLength = 3; |
| 6568 static const int kFirstContextSlot = FixedArray::kHeaderSize + kPointerSize; | 6572 static const int kFirstContextSlot = FixedArray::kHeaderSize + kPointerSize; |
| 6569 static const int kFirstCodeSlot = FixedArray::kHeaderSize + 2 * kPointerSize; | 6573 static const int kFirstCodeSlot = FixedArray::kHeaderSize + 2 * kPointerSize; |
| 6570 static const int kSecondEntryIndex = kEntryLength + kEntriesStart; | 6574 static const int kSecondEntryIndex = kEntryLength + kEntriesStart; |
| 6571 static const int kInitialLength = kEntriesStart + kEntryLength; | 6575 static const int kInitialLength = kEntriesStart + kEntryLength; |
| 6572 | 6576 |
| (...skipping 4039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10612 } else { | 10616 } else { |
| 10613 value &= ~(1 << bit_position); | 10617 value &= ~(1 << bit_position); |
| 10614 } | 10618 } |
| 10615 return value; | 10619 return value; |
| 10616 } | 10620 } |
| 10617 }; | 10621 }; |
| 10618 | 10622 |
| 10619 } } // namespace v8::internal | 10623 } } // namespace v8::internal |
| 10620 | 10624 |
| 10621 #endif // V8_OBJECTS_H_ | 10625 #endif // V8_OBJECTS_H_ |
| OLD | NEW |