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

Side by Side Diff: src/objects.h

Issue 1516833002: Tighten the interface to the optimized code map (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nit. Created 5 years 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/factory.cc ('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 6491 matching lines...) Expand 10 before | Expand all | Expand 10 after
6502 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason); 6502 void EvictFromOptimizedCodeMap(Code* optimized_code, const char* reason);
6503 6503
6504 // Trims the optimized code map after entries have been removed. 6504 // Trims the optimized code map after entries have been removed.
6505 void TrimOptimizedCodeMap(int shrink_by); 6505 void TrimOptimizedCodeMap(int shrink_by);
6506 6506
6507 // Add a new entry to the optimized code map for context-independent code. 6507 // Add a new entry to the optimized code map for context-independent code.
6508 static void AddSharedCodeToOptimizedCodeMap(Handle<SharedFunctionInfo> shared, 6508 static void AddSharedCodeToOptimizedCodeMap(Handle<SharedFunctionInfo> shared,
6509 Handle<Code> code); 6509 Handle<Code> code);
6510 6510
6511 // Add a new entry to the optimized code map for context-dependent code. 6511 // Add a new entry to the optimized code map for context-dependent code.
6512 // |code| is either a code object or an undefined value. In the latter case 6512 inline static void AddToOptimizedCodeMap(Handle<SharedFunctionInfo> shared,
6513 // the entry just maps |native_context, osr_ast_id| pair to |literals| array. 6513 Handle<Context> native_context,
6514 static void AddToOptimizedCodeMap(Handle<SharedFunctionInfo> shared, 6514 Handle<Code> code,
6515 Handle<Context> native_context, 6515 Handle<LiteralsArray> literals,
6516 Handle<HeapObject> code, 6516 BailoutId osr_ast_id);
6517 Handle<LiteralsArray> literals,
6518 BailoutId osr_ast_id);
6519 6517
6518 inline static void AddLiteralsToOptimizedCodeMap(
Michael Starzinger 2015/12/10 14:57:28 nit: Can we have a short comment explaining this m
mvstanton 2015/12/10 15:21:49 Done.
6519 Handle<SharedFunctionInfo> shared, Handle<Context> native_context,
6520 Handle<LiteralsArray> literals, BailoutId osr_ast_id);
Michael Starzinger 2015/12/10 14:57:28 This should not need a {BailoutId}, because withou
mvstanton 2015/12/10 15:21:48 doh! Absolutely, thanks!
6521
6522 private:
6523 // If code is undefined, then existing code won't be overwritten.
6524 static void AddToOptimizedCodeMapInternal(Handle<SharedFunctionInfo> shared,
6525 Handle<Context> native_context,
6526 Handle<HeapObject> code,
6527 Handle<LiteralsArray> literals,
6528 BailoutId osr_ast_id);
6529
6530 public:
6520 // Set up the link between shared function info and the script. The shared 6531 // Set up the link between shared function info and the script. The shared
6521 // function info is added to the list on the script. 6532 // function info is added to the list on the script.
6522 static void SetScript(Handle<SharedFunctionInfo> shared, 6533 static void SetScript(Handle<SharedFunctionInfo> shared,
6523 Handle<Object> script_object); 6534 Handle<Object> script_object);
6524 6535
6525 // Layout description of the optimized code map. 6536 // Layout description of the optimized code map.
6526 static const int kSharedCodeIndex = 0; 6537 static const int kSharedCodeIndex = 0;
6527 static const int kEntriesStart = 1; 6538 static const int kEntriesStart = 1;
6528 static const int kContextOffset = 0; 6539 static const int kContextOffset = 0;
6529 static const int kCachedCodeOffset = 1; 6540 static const int kCachedCodeOffset = 1;
(...skipping 4148 matching lines...) Expand 10 before | Expand all | Expand 10 after
10678 } 10689 }
10679 return value; 10690 return value;
10680 } 10691 }
10681 }; 10692 };
10682 10693
10683 10694
10684 } // NOLINT, false-positive due to second-order macros. 10695 } // NOLINT, false-positive due to second-order macros.
10685 } // NOLINT, false-positive due to second-order macros. 10696 } // NOLINT, false-positive due to second-order macros.
10686 10697
10687 #endif // V8_OBJECTS_H_ 10698 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698