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

Unified Diff: src/mark-compact.cc

Issue 101853003: Cache optimized code for OSR. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.h » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 578d580159a21fbab3a92dd8bb109e7eb985a32c..c48f2c84c09695e66652448c137745261687f5a7 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1067,10 +1067,11 @@ void CodeFlusher::ProcessSharedFunctionInfoCandidates() {
void CodeFlusher::ProcessOptimizedCodeMaps() {
static const int kEntriesStart = SharedFunctionInfo::kEntriesStart;
static const int kEntryLength = SharedFunctionInfo::kEntryLength;
- static const int kContextOffset = 0;
- static const int kCodeOffset = 1;
- static const int kLiteralsOffset = 2;
- STATIC_ASSERT(kEntryLength == 3);
+ static const int kContextOffset = SharedFunctionInfo::kContextOffset;
titzer 2013/12/16 11:59:34 Duplicated constants for code shortitude below. Pr
+ static const int kCodeOffset = SharedFunctionInfo::kCachedCodeOffset;
+ static const int kLiteralsOffset = SharedFunctionInfo::kLiteralsOffset;
+ static const int kOsrAstIdOffset = SharedFunctionInfo::kOsrAstIdOffset;
+ STATIC_ASSERT(kEntryLength == 4);
SharedFunctionInfo* holder = optimized_code_map_holder_head_;
SharedFunctionInfo* next_holder;
@@ -1114,6 +1115,10 @@ void CodeFlusher::ProcessOptimizedCodeMaps() {
Marking::MarkBitFrom(HeapObject::cast(*literals_slot))));
isolate_->heap()->mark_compact_collector()->
RecordSlot(literals_slot, literals_slot, *literals_slot);
+
+ // Update OSR AST id. No write barrier necessary for a smi.
+ ASSERT(code_map->get(i + kOsrAstIdOffset)->IsSmi());
+ code_map->set(new_length++, code_map->get(i + kOsrAstIdOffset));
}
// Trim the optimized code map if entries have been removed.
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698