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

Side by Side Diff: src/mips/builtins-mips.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/messages.js ('k') | src/mips/code-stubs-mips.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 5
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 1306
1307 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); 1307 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
1308 __ GetObjectType(a2, a3, a3); 1308 __ GetObjectType(a2, a3, a3);
1309 __ Branch(&shift_arguments, ge, a3, Operand(FIRST_SPEC_OBJECT_TYPE)); 1309 __ Branch(&shift_arguments, ge, a3, Operand(FIRST_SPEC_OBJECT_TYPE));
1310 1310
1311 __ bind(&convert_to_object); 1311 __ bind(&convert_to_object);
1312 // Enter an internal frame in order to preserve argument count. 1312 // Enter an internal frame in order to preserve argument count.
1313 { 1313 {
1314 FrameScope scope(masm, StackFrame::INTERNAL); 1314 FrameScope scope(masm, StackFrame::INTERNAL);
1315 __ sll(a0, a0, kSmiTagSize); // Smi tagged. 1315 __ sll(a0, a0, kSmiTagSize); // Smi tagged.
1316 __ Push(a0, a2); 1316 __ push(a0);
1317 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1317 __ mov(a0, a2);
1318 ToObjectStub stub(masm->isolate());
1319 __ CallStub(&stub);
1318 __ mov(a2, v0); 1320 __ mov(a2, v0);
1319 1321
1320 __ pop(a0); 1322 __ pop(a0);
1321 __ sra(a0, a0, kSmiTagSize); // Un-tag. 1323 __ sra(a0, a0, kSmiTagSize); // Un-tag.
1322 // Leave internal frame. 1324 // Leave internal frame.
1323 } 1325 }
1324 1326
1325 // Restore the function to a1, and the flag to t0. 1327 // Restore the function to a1, and the flag to t0.
1326 __ sll(at, a0, kPointerSizeLog2); 1328 __ sll(at, a0, kPointerSizeLog2);
1327 __ addu(at, sp, at); 1329 __ addu(at, sp, at);
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1541 1543
1542 // Check if the receiver is already a JavaScript object. 1544 // Check if the receiver is already a JavaScript object.
1543 // a0: receiver 1545 // a0: receiver
1544 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); 1546 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
1545 __ GetObjectType(a0, a1, a1); 1547 __ GetObjectType(a0, a1, a1);
1546 __ Branch(&push_receiver, ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE)); 1548 __ Branch(&push_receiver, ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE));
1547 1549
1548 // Convert the receiver to a regular object. 1550 // Convert the receiver to a regular object.
1549 // a0: receiver 1551 // a0: receiver
1550 __ bind(&call_to_object); 1552 __ bind(&call_to_object);
1551 __ push(a0); 1553 ToObjectStub stub(masm->isolate());
1552 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1554 __ CallStub(&stub);
1553 __ mov(a0, v0); // Put object in a0 to match other paths to push_receiver. 1555 __ mov(a0, v0); // Put object in a0 to match other paths to push_receiver.
1554 __ Branch(&push_receiver); 1556 __ Branch(&push_receiver);
1555 1557
1556 __ bind(&use_global_proxy); 1558 __ bind(&use_global_proxy);
1557 __ lw(a0, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); 1559 __ lw(a0, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
1558 __ lw(a0, FieldMemOperand(a0, GlobalObject::kGlobalProxyOffset)); 1560 __ lw(a0, FieldMemOperand(a0, GlobalObject::kGlobalProxyOffset));
1559 1561
1560 // Push the receiver. 1562 // Push the receiver.
1561 // a0: receiver 1563 // a0: receiver
1562 __ bind(&push_receiver); 1564 __ bind(&push_receiver);
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1870 } 1872 }
1871 } 1873 }
1872 1874
1873 1875
1874 #undef __ 1876 #undef __
1875 1877
1876 } // namespace internal 1878 } // namespace internal
1877 } // namespace v8 1879 } // namespace v8
1878 1880
1879 #endif // V8_TARGET_ARCH_MIPS 1881 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698