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

Side by Side Diff: src/runtime/runtime-array.cc

Issue 2571563004: [Turbofan] Implement super calls with spread bytecode in assembly code. (Closed)
Patch Set: Change arm64 loop to be similar to the rest Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/elements.h" 10 #include "src/elements.h"
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 Handle<JSFunction> spread_iterable_function = isolate->spread_iterable(); 641 Handle<JSFunction> spread_iterable_function = isolate->spread_iterable();
642 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 642 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
643 isolate, spread, 643 isolate, spread,
644 Execution::Call(isolate, spread_iterable_function, 644 Execution::Call(isolate, spread_iterable_function,
645 isolate->factory()->undefined_value(), 1, &spread)); 645 isolate->factory()->undefined_value(), 1, &spread));
646 } 646 }
647 647
648 return *spread; 648 return *spread;
649 } 649 }
650 650
651 RUNTIME_FUNCTION(Runtime_SpreadIterableFixed) {
652 HandleScope scope(isolate);
653 DCHECK_EQ(1, args.length());
654 CONVERT_ARG_HANDLE_CHECKED(Object, spread, 0);
655
656 // The caller should check if proper iteration is necessary.
657 Handle<JSFunction> spread_iterable_function = isolate->spread_iterable();
658 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
659 isolate, spread,
660 Execution::Call(isolate, spread_iterable_function,
661 isolate->factory()->undefined_value(), 1, &spread));
662
663 // Create a new FixedArray and put the result of the spread into it.
664 Handle<JSArray> spread_array = Handle<JSArray>::cast(spread);
665 uint32_t spread_length;
666 CHECK(spread_array->length()->ToArrayIndex(&spread_length));
667
668 Handle<FixedArray> result = isolate->factory()->NewFixedArray(spread_length);
669 ElementsAccessor* accessor = spread_array->GetElementsAccessor();
670 for (uint32_t i = 0; i < spread_length; i++) {
671 DCHECK(accessor->HasElement(spread_array, i));
672 Handle<Object> element = accessor->Get(spread_array, i);
673 result->set(i, *element);
674 }
675
676 return *result;
677 }
678
651 } // namespace internal 679 } // namespace internal
652 } // namespace v8 680 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698