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

Unified Diff: src/runtime/runtime-array.cc

Issue 2571563004: [Turbofan] Implement super calls with spread bytecode in assembly code. (Closed)
Patch Set: Rebase on master 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/builtins/x64/builtins-x64.cc ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-array.cc
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc
index cb849d2067ad0bb02a539817e6ef9ea5221a0942..c95ef969bfabe2a7e6c450a247eb11299bd5a771 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -648,5 +648,28 @@ RUNTIME_FUNCTION(Runtime_SpreadIterablePrepare) {
return *spread;
}
+RUNTIME_FUNCTION(Runtime_SpreadIterablePrepareFixed) {
+ HandleScope scope(isolate);
+ DCHECK_EQ(1, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(Object, spread, 0);
+
+ // Iterate over the spread if we need to.
+ if (spread->IterationHasObservableEffects()) {
+ Handle<JSFunction> spread_iterable_function = isolate->spread_iterable();
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, spread,
+ Execution::Call(isolate, spread_iterable_function,
+ isolate->factory()->undefined_value(), 1, &spread));
+ }
+ // Return the backing store fixed array.
+ Handle<JSArray> spread_array = Handle<JSArray>::cast(spread);
+ uint32_t spread_length;
+ CHECK(spread_array->length()->ToArrayIndex(&spread_length));
+
+ FixedArrayBase* a = spread_array->elements();
+ a->set_length(spread_length);
+ return a;
+}
+
} // namespace internal
} // namespace v8
« src/builtins/x64/builtins-x64.cc ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698