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

Unified Diff: src/heap.cc

Issue 23691002: Add OptimizedCodeEntry as a new heap object type. An optimized code entry represents an association… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months 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/heap.h ('k') | src/objects.h » ('j') | src/objects.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index ad352bce50ee38990042edfe746708872799c73d..14e7aa92c0e403b571ca0e27733910d4859d29dc 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2824,6 +2824,12 @@ bool Heap::CreateInitialMaps() {
}
set_shared_function_info_map(Map::cast(obj));
+ { MaybeObject* maybe_obj = AllocateMap(OPTIMIZED_CODE_ENTRY_TYPE,
+ OptimizedCodeEntry::kAlignedSize);
+ if (!maybe_obj->ToObject(&obj)) return false;
+ }
+ set_optimized_code_entry_map(Map::cast(obj));
+
{ MaybeObject* maybe_obj = AllocateMap(JS_MESSAGE_OBJECT_TYPE,
JSMessageObject::kSize);
if (!maybe_obj->ToObject(&obj)) return false;
@@ -3651,6 +3657,30 @@ MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) {
}
+MaybeObject* Heap::AllocateOptimizedCodeEntry(
+ Context* native_context,
+ JSFunction* function,
+ Code* code,
+ FixedArray* literals) {
+ OptimizedCodeEntry* entry;
+ MaybeObject* maybe = Allocate(optimized_code_entry_map(), OLD_POINTER_SPACE);
+ if (!maybe->To<OptimizedCodeEntry>(&entry)) return maybe;
+
+ // Set pointer fields.
+ entry->set_native_context(native_context, SKIP_WRITE_BARRIER);
Michael Starzinger 2013/08/28 14:59:47 Skipping WBs for all four of these setters is not
+ entry->set_function(function, SKIP_WRITE_BARRIER);
+ entry->set_code(code, SKIP_WRITE_BARRIER);
+ entry->set_literals(literals, SKIP_WRITE_BARRIER);
+
+ // NULL-out link fields.
+ entry->set_next_by_shared_info(NULL, SKIP_WRITE_BARRIER);
+ entry->set_next_by_native_context(NULL, SKIP_WRITE_BARRIER);
+ entry->set_cacheable(false);
+
+ return entry;
+}
+
+
MaybeObject* Heap::AllocateJSMessageObject(String* type,
JSArray* arguments,
int start_position,
« no previous file with comments | « src/heap.h ('k') | src/objects.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698