Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: src/objects.h

Issue 1433923002: Maintain a FixedArray for the optimized code map. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6459 matching lines...) Expand 10 before | Expand all | Expand 10 after
6470 class SharedFunctionInfo: public HeapObject { 6470 class SharedFunctionInfo: public HeapObject {
6471 public: 6471 public:
6472 // [name]: Function name. 6472 // [name]: Function name.
6473 DECL_ACCESSORS(name, Object) 6473 DECL_ACCESSORS(name, Object)
6474 6474
6475 // [code]: Function code. 6475 // [code]: Function code.
6476 DECL_ACCESSORS(code, Code) 6476 DECL_ACCESSORS(code, Code)
6477 inline void ReplaceCode(Code* code); 6477 inline void ReplaceCode(Code* code);
6478 6478
6479 // [optimized_code_map]: Map from native context to optimized code 6479 // [optimized_code_map]: Map from native context to optimized code
6480 // and a shared literals array or Smi(0) if none. 6480 // and a shared literals array.
6481 DECL_ACCESSORS(optimized_code_map, Object) 6481 DECL_ACCESSORS(optimized_code_map, FixedArray)
6482 6482
6483 // Returns entry from optimized code map for specified context and OSR entry. 6483 // Returns entry from optimized code map for specified context and OSR entry.
6484 // Note that {code == nullptr, literals == nullptr} indicates no matching 6484 // Note that {code == nullptr, literals == nullptr} indicates no matching
6485 // entry has been found, whereas {code, literals == nullptr} indicates that 6485 // entry has been found, whereas {code, literals == nullptr} indicates that
6486 // code is context-independent. 6486 // code is context-independent.
6487 CodeAndLiterals SearchOptimizedCodeMap(Context* native_context, 6487 CodeAndLiterals SearchOptimizedCodeMap(Context* native_context,
6488 BailoutId osr_ast_id); 6488 BailoutId osr_ast_id);
6489 6489
6490 // Clear optimized code map. 6490 // Clear optimized code map.
6491 void ClearOptimizedCodeMap(); 6491 void ClearOptimizedCodeMap();
6492 6492
6493 // We have a special root FixedArray with the right shape and values
6494 // to represent the cleared optimized code map. This predicate checks
6495 // if that root is installed.
6496 inline bool OptimizedCodeMapIsCleared() const;
6497
6493 // Removes a specific optimized code object from the optimized code map. 6498 // Removes a specific optimized code object from the optimized code map.
6494 // In case of non-OSR the code reference is cleared from the cache entry but 6499 // In case of non-OSR the code reference is cleared from the cache entry but
6495 // the entry itself is left in the map in order to proceed sharing literals. 6500 // the entry itself is left in the map in order to proceed sharing literals.
6496 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason); 6501 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason);
6497 6502
6498 // Trims the optimized code map after entries have been removed. 6503 // Trims the optimized code map after entries have been removed.
6499 void TrimOptimizedCodeMap(int shrink_by); 6504 void TrimOptimizedCodeMap(int shrink_by);
6500 6505
6501 // Add a new entry to the optimized code map for context-independent code. 6506 // Add a new entry to the optimized code map for context-independent code.
6502 static void AddSharedCodeToOptimizedCodeMap(Handle<SharedFunctionInfo> shared, 6507 static void AddSharedCodeToOptimizedCodeMap(Handle<SharedFunctionInfo> shared,
(...skipping 4203 matching lines...) Expand 10 before | Expand all | Expand 10 after
10706 } 10711 }
10707 return value; 10712 return value;
10708 } 10713 }
10709 }; 10714 };
10710 10715
10711 10716
10712 } // NOLINT, false-positive due to second-order macros. 10717 } // NOLINT, false-positive due to second-order macros.
10713 } // NOLINT, false-positive due to second-order macros. 10718 } // NOLINT, false-positive due to second-order macros.
10714 10719
10715 #endif // V8_OBJECTS_H_ 10720 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698