OLD | NEW |
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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 1331 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
1332 __ CompareObjectType(r5, r6, r6, FIRST_SPEC_OBJECT_TYPE); | 1332 __ CompareObjectType(r5, r6, r6, FIRST_SPEC_OBJECT_TYPE); |
1333 __ bge(&shift_arguments); | 1333 __ bge(&shift_arguments); |
1334 | 1334 |
1335 __ bind(&convert_to_object); | 1335 __ bind(&convert_to_object); |
1336 | 1336 |
1337 { | 1337 { |
1338 // Enter an internal frame in order to preserve argument count. | 1338 // Enter an internal frame in order to preserve argument count. |
1339 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1339 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
1340 __ SmiTag(r3); | 1340 __ SmiTag(r3); |
1341 __ Push(r3, r5); | 1341 __ Push(r3); |
1342 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 1342 __ mr(r3, r5); |
| 1343 ToObjectStub stub(masm->isolate()); |
| 1344 __ CallStub(&stub); |
1343 __ mr(r5, r3); | 1345 __ mr(r5, r3); |
1344 | 1346 |
1345 __ pop(r3); | 1347 __ pop(r3); |
1346 __ SmiUntag(r3); | 1348 __ SmiUntag(r3); |
1347 | 1349 |
1348 // Exit the internal frame. | 1350 // Exit the internal frame. |
1349 } | 1351 } |
1350 | 1352 |
1351 // Restore the function to r4, and the flag to r7. | 1353 // Restore the function to r4, and the flag to r7. |
1352 __ ShiftLeftImm(r7, r3, Operand(kPointerSizeLog2)); | 1354 __ ShiftLeftImm(r7, r3, Operand(kPointerSizeLog2)); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 | 1587 |
1586 // Check if the receiver is already a JavaScript object. | 1588 // Check if the receiver is already a JavaScript object. |
1587 // r3: receiver | 1589 // r3: receiver |
1588 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 1590 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
1589 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE); | 1591 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE); |
1590 __ bge(&push_receiver); | 1592 __ bge(&push_receiver); |
1591 | 1593 |
1592 // Convert the receiver to a regular object. | 1594 // Convert the receiver to a regular object. |
1593 // r3: receiver | 1595 // r3: receiver |
1594 __ bind(&call_to_object); | 1596 __ bind(&call_to_object); |
1595 __ push(r3); | 1597 ToObjectStub stub(masm->isolate()); |
1596 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 1598 __ CallStub(&stub); |
1597 __ b(&push_receiver); | 1599 __ b(&push_receiver); |
1598 | 1600 |
1599 __ bind(&use_global_proxy); | 1601 __ bind(&use_global_proxy); |
1600 __ LoadP(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 1602 __ LoadP(r3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
1601 __ LoadP(r3, FieldMemOperand(r3, GlobalObject::kGlobalProxyOffset)); | 1603 __ LoadP(r3, FieldMemOperand(r3, GlobalObject::kGlobalProxyOffset)); |
1602 | 1604 |
1603 // Push the receiver. | 1605 // Push the receiver. |
1604 // r3: receiver | 1606 // r3: receiver |
1605 __ bind(&push_receiver); | 1607 __ bind(&push_receiver); |
1606 __ push(r3); | 1608 __ push(r3); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1916 __ bkpt(0); | 1918 __ bkpt(0); |
1917 } | 1919 } |
1918 } | 1920 } |
1919 | 1921 |
1920 | 1922 |
1921 #undef __ | 1923 #undef __ |
1922 } // namespace internal | 1924 } // namespace internal |
1923 } // namespace v8 | 1925 } // namespace v8 |
1924 | 1926 |
1925 #endif // V8_TARGET_ARCH_PPC | 1927 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |