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

Side by Side Diff: src/arm64/builtins-arm64.cc

Issue 1266013006: [stubs] Unify (and optimize) implementation of ToObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing support for %_ToObject in TurboFan and Crankshaft. Created 5 years, 4 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
« no previous file with comments | « src/arm/interface-descriptors-arm.cc ('k') | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/debug.h" 10 #include "src/debug.h"
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 __ JumpIfObjectType(receiver, scratch1, scratch2, 1348 __ JumpIfObjectType(receiver, scratch1, scratch2,
1349 FIRST_SPEC_OBJECT_TYPE, &shift_arguments, ge); 1349 FIRST_SPEC_OBJECT_TYPE, &shift_arguments, ge);
1350 1350
1351 __ Bind(&convert_to_object); 1351 __ Bind(&convert_to_object);
1352 1352
1353 { 1353 {
1354 // Enter an internal frame in order to preserve argument count. 1354 // Enter an internal frame in order to preserve argument count.
1355 FrameScope scope(masm, StackFrame::INTERNAL); 1355 FrameScope scope(masm, StackFrame::INTERNAL);
1356 __ SmiTag(argc); 1356 __ SmiTag(argc);
1357 1357
1358 __ Push(argc, receiver); 1358 __ Push(argc);
1359 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1359 __ Mov(x0, receiver);
1360 ToObjectStub stub(masm->isolate());
1361 __ CallStub(&stub);
1360 __ Mov(receiver, x0); 1362 __ Mov(receiver, x0);
1361 1363
1362 __ Pop(argc); 1364 __ Pop(argc);
1363 __ SmiUntag(argc); 1365 __ SmiUntag(argc);
1364 1366
1365 // Exit the internal frame. 1367 // Exit the internal frame.
1366 } 1368 }
1367 1369
1368 // Restore the function and flag in the registers. 1370 // Restore the function and flag in the registers.
1369 __ Peek(function, Operand(argc, LSL, kXRegSizeLog2)); 1371 __ Peek(function, Operand(argc, LSL, kXRegSizeLog2));
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 __ JumpIfRoot(receiver, Heap::kUndefinedValueRootIndex, 1577 __ JumpIfRoot(receiver, Heap::kUndefinedValueRootIndex,
1576 &use_global_proxy); 1578 &use_global_proxy);
1577 1579
1578 // Check if the receiver is already a JavaScript object. 1580 // Check if the receiver is already a JavaScript object.
1579 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); 1581 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
1580 __ JumpIfObjectType(receiver, x10, x11, FIRST_SPEC_OBJECT_TYPE, 1582 __ JumpIfObjectType(receiver, x10, x11, FIRST_SPEC_OBJECT_TYPE,
1581 &push_receiver, ge); 1583 &push_receiver, ge);
1582 1584
1583 // Call a builtin to convert the receiver to a regular object. 1585 // Call a builtin to convert the receiver to a regular object.
1584 __ Bind(&convert_receiver_to_object); 1586 __ Bind(&convert_receiver_to_object);
1585 __ Push(receiver); 1587 __ Mov(x0, receiver);
1586 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1588 ToObjectStub stub(masm->isolate());
1589 __ CallStub(&stub);
1587 __ Mov(receiver, x0); 1590 __ Mov(receiver, x0);
1588 __ B(&push_receiver); 1591 __ B(&push_receiver);
1589 1592
1590 __ Bind(&use_global_proxy); 1593 __ Bind(&use_global_proxy);
1591 __ Ldr(x10, GlobalObjectMemOperand()); 1594 __ Ldr(x10, GlobalObjectMemOperand());
1592 __ Ldr(receiver, FieldMemOperand(x10, GlobalObject::kGlobalProxyOffset)); 1595 __ Ldr(receiver, FieldMemOperand(x10, GlobalObject::kGlobalProxyOffset));
1593 1596
1594 // Push the receiver 1597 // Push the receiver
1595 __ Bind(&push_receiver); 1598 __ Bind(&push_receiver);
1596 __ Push(receiver); 1599 __ Push(receiver);
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 } 1926 }
1924 } 1927 }
1925 1928
1926 1929
1927 #undef __ 1930 #undef __
1928 1931
1929 } // namespace internal 1932 } // namespace internal
1930 } // namespace v8 1933 } // namespace v8
1931 1934
1932 #endif // V8_TARGET_ARCH_ARM 1935 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/interface-descriptors-arm.cc ('k') | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698