Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index e484c80203fe6e9b4817c3215cc18ee95a7887e3..fa5892146025790d728cd0747edcbddbd6ef8f49 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -2430,6 +2430,16 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, |
Builtins::kReflectSetPrototypeOf, 2, true); |
} |
+ { // --- S P R E A D |
+ Handle<JSObject> spread = |
+ factory->NewJSObject(isolate->object_function(), TENURED); |
+ |
+ Handle<JSFunction> apply_prepare = SimpleInstallFunction( |
+ spread, factory->NewStringFromAsciiChecked("SpreadIterablePrepare"), |
+ Builtins::kSpreadIterablePrepare, 1, false); |
Yang
2016/11/08 14:08:41
Why do we need this? I think what you want is to c
petermarshall
2016/11/10 12:19:20
Yep I've moved it to a runtime function
|
+ native_context()->set_spread_iterable_prepare(*apply_prepare); |
+ } |
+ |
{ // --- B o u n d F u n c t i o n |
Handle<Map> map = |
factory->NewMap(JS_BOUND_FUNCTION_TYPE, JSBoundFunction::kSize); |
@@ -3479,6 +3489,20 @@ bool Genesis::InstallNatives(GlobalContextType context_type) { |
if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false; |
} |
+ // Store the initial array iterator on the native context. |
+ { |
+ Handle<JSFunction> array_constructor(native_context()->array_function()); |
+ Handle<JSObject> array_prototype( |
+ JSObject::cast(array_constructor->instance_prototype())); |
+ |
+ Handle<Object> iterator_func = |
+ Object::GetProperty(array_prototype, factory()->iterator_symbol()) |
+ .ToHandleChecked(); |
+ DCHECK(iterator_func->IsJSFunction()); |
+ native_context()->set_initial_array_iterator( |
Yang
2016/11/08 14:08:41
Isn't this the same thing as native_context()->arr
petermarshall
2016/11/10 12:19:20
Removed this anyway - no longer needed
|
+ JSObject::cast(*iterator_func)); |
+ } |
+ |
if (!CallUtilsFunction(isolate(), "PostNatives")) return false; |
auto fast_template_instantiations_cache = isolate()->factory()->NewFixedArray( |
TemplateInfo::kFastTemplateInstantiationsCacheSize); |