| Index: src/builtins.cc
|
| diff --git a/src/builtins.cc b/src/builtins.cc
|
| index 1af71de0f19d39a7d7a952171d5ce800cf94bbea..2f2e9d7444db42f98c3a74e9a9e2a229fe6b2728 100644
|
| --- a/src/builtins.cc
|
| +++ b/src/builtins.cc
|
| @@ -442,7 +442,10 @@ BUILTIN(ObjectHasOwnProperty) {
|
| return isolate->heap()->false_value();
|
| }
|
|
|
| -BUILTIN(ArrayPush) {
|
| +namespace {
|
| +
|
| +Object* DoArrayPush(Isolate* isolate,
|
| + BuiltinArguments<BuiltinExtraArguments::kNone> args) {
|
| HandleScope scope(isolate);
|
| Handle<Object> receiver = args.receiver();
|
| if (!EnsureJSArrayWithWritableFastElements(isolate, receiver, &args, 1)) {
|
| @@ -466,6 +469,20 @@ BUILTIN(ArrayPush) {
|
| return Smi::FromInt(new_length);
|
| }
|
|
|
| +} // namespace
|
| +
|
| +BUILTIN(ArrayPush) { return DoArrayPush(isolate, args); }
|
| +
|
| +// TODO(verwaest): This is a temporary helper until the FastArrayPush stub can
|
| +// tailcall to the builtin directly.
|
| +RUNTIME_FUNCTION(Runtime_ArrayPush) {
|
| + DCHECK_EQ(2, args.length());
|
| + Arguments* incoming = reinterpret_cast<Arguments*>(args[0]);
|
| + // Rewrap the arguments as builtins arguments.
|
| + BuiltinArguments<BuiltinExtraArguments::kNone> caller_args(
|
| + incoming->length() + 1, incoming->arguments() + 1);
|
| + return DoArrayPush(isolate, caller_args);
|
| +}
|
|
|
| BUILTIN(ArrayPop) {
|
| HandleScope scope(isolate);
|
|
|