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, |