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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 __ add(sp, sp, r0); | 1562 __ add(sp, sp, r0); |
1563 } | 1563 } |
1564 | 1564 |
1565 | 1565 |
1566 // static | 1566 // static |
1567 void Builtins::Generate_CallFunction(MacroAssembler* masm) { | 1567 void Builtins::Generate_CallFunction(MacroAssembler* masm) { |
1568 // ----------- S t a t e ------------- | 1568 // ----------- S t a t e ------------- |
1569 // -- r3 : the number of arguments (not including the receiver) | 1569 // -- r3 : the number of arguments (not including the receiver) |
1570 // -- r4 : the function to call (checked to be a JSFunction) | 1570 // -- r4 : the function to call (checked to be a JSFunction) |
1571 // ----------------------------------- | 1571 // ----------------------------------- |
| 1572 // See ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList) |
1572 | 1573 |
1573 Label convert, convert_global_proxy, convert_to_object, done_convert; | 1574 Label convert, convert_global_proxy, convert_to_object, done_convert; |
1574 __ AssertFunction(r4); | 1575 __ AssertFunction(r4); |
1575 // TODO(bmeurer): Throw a TypeError if function's [[FunctionKind]] internal | 1576 // TODO(bmeurer): Throw a TypeError if function's [[FunctionKind]] internal |
1576 // slot is "classConstructor". | 1577 // slot is "classConstructor". |
1577 // Enter the context of the function; ToObject has to run in the function | 1578 // Enter the context of the function; ToObject has to run in the function |
1578 // context, and we also need to take the global proxy from the function | 1579 // context, and we also need to take the global proxy from the function |
1579 // context in case of conversion. | 1580 // context in case of conversion. |
1580 // See ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList) | |
1581 STATIC_ASSERT(SharedFunctionInfo::kNativeByteOffset == | 1581 STATIC_ASSERT(SharedFunctionInfo::kNativeByteOffset == |
1582 SharedFunctionInfo::kStrictModeByteOffset); | 1582 SharedFunctionInfo::kStrictModeByteOffset); |
1583 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); | 1583 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); |
1584 __ LoadP(r5, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | 1584 __ LoadP(r5, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
1585 // We need to convert the receiver for non-native sloppy mode functions. | 1585 // We need to convert the receiver for non-native sloppy mode functions. |
1586 __ lbz(r6, FieldMemOperand(r5, SharedFunctionInfo::kNativeByteOffset)); | 1586 __ lbz(r6, FieldMemOperand(r5, SharedFunctionInfo::kNativeByteOffset)); |
1587 __ andi(r0, r6, Operand((1 << SharedFunctionInfo::kNativeBitWithinByte) | | 1587 __ andi(r0, r6, Operand((1 << SharedFunctionInfo::kNativeBitWithinByte) | |
1588 (1 << SharedFunctionInfo::kStrictModeBitWithinByte))); | 1588 (1 << SharedFunctionInfo::kStrictModeBitWithinByte))); |
1589 __ bne(&done_convert, cr0); | 1589 __ bne(&done_convert, cr0); |
1590 { | 1590 { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 __ bkpt(0); | 1941 __ bkpt(0); |
1942 } | 1942 } |
1943 } | 1943 } |
1944 | 1944 |
1945 | 1945 |
1946 #undef __ | 1946 #undef __ |
1947 } // namespace internal | 1947 } // namespace internal |
1948 } // namespace v8 | 1948 } // namespace v8 |
1949 | 1949 |
1950 #endif // V8_TARGET_ARCH_PPC | 1950 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |