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

Unified Diff: src/factory.cc

Issue 2547483002: Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID (Closed)
Patch Set: Created 4 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
« src/debug/liveedit.js ('K') | « src/factory.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 3c6eb250ee2329ad79b7294dad6bc34b5eccd33f..d7484c681c3be27756d09b3016a1a6909c29bdfa 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -159,6 +159,13 @@ Handle<FixedArray> Factory::NewFixedArrayWithHoles(int size,
FixedArray);
}
+Handle<FixedArray> Factory::NewFixedArrayWithSmis(int size, int value,
+ PretenureFlag pretenure) {
+ DCHECK_LT(0, size);
+ CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateFixedArrayWithFiller(
+ size, pretenure, Smi::FromInt(value)),
+ FixedArray);
+}
Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) {
CALL_HEAP_FUNCTION(
@@ -1050,7 +1057,7 @@ Handle<Script> Factory::NewScript(Handle<String> source) {
script->set_line_ends(heap->undefined_value());
script->set_eval_from_shared(heap->undefined_value());
script->set_eval_from_position(0);
- script->set_shared_function_infos(Smi::kZero);
+ script->set_shared_function_infos(*empty_fixed_array(), SKIP_WRITE_BARRIER);
script->set_flags(0);
heap->set_script_list(*WeakFixedArray::Add(script_list(), script));
« src/debug/liveedit.js ('K') | « src/factory.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698