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/crankshaft/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 3571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3582 dont_adapt_arguments || formal_parameter_count == arity; | 3582 dont_adapt_arguments || formal_parameter_count == arity; |
3583 | 3583 |
3584 Register function_reg = r4; | 3584 Register function_reg = r4; |
3585 | 3585 |
3586 LPointerMap* pointers = instr->pointer_map(); | 3586 LPointerMap* pointers = instr->pointer_map(); |
3587 | 3587 |
3588 if (can_invoke_directly) { | 3588 if (can_invoke_directly) { |
3589 // Change context. | 3589 // Change context. |
3590 __ LoadP(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); | 3590 __ LoadP(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); |
3591 | 3591 |
3592 // Always initialize r3 to the number of actual arguments. | 3592 // Always initialize new target and number of actual arguments. |
| 3593 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); |
3593 __ mov(r3, Operand(arity)); | 3594 __ mov(r3, Operand(arity)); |
3594 | 3595 |
3595 bool is_self_call = function.is_identical_to(info()->closure()); | 3596 bool is_self_call = function.is_identical_to(info()->closure()); |
3596 | 3597 |
3597 // Invoke function. | 3598 // Invoke function. |
3598 if (is_self_call) { | 3599 if (is_self_call) { |
3599 __ CallSelf(); | 3600 __ CallSelf(); |
3600 } else { | 3601 } else { |
3601 __ LoadP(ip, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset)); | 3602 __ LoadP(ip, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset)); |
3602 __ CallJSEntry(ip); | 3603 __ CallJSEntry(ip); |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3996 } | 3997 } |
3997 generator.AfterCall(); | 3998 generator.AfterCall(); |
3998 } | 3999 } |
3999 } | 4000 } |
4000 | 4001 |
4001 | 4002 |
4002 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { | 4003 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { |
4003 DCHECK(ToRegister(instr->function()).is(r4)); | 4004 DCHECK(ToRegister(instr->function()).is(r4)); |
4004 DCHECK(ToRegister(instr->result()).is(r3)); | 4005 DCHECK(ToRegister(instr->result()).is(r3)); |
4005 | 4006 |
4006 __ mov(r3, Operand(instr->arity())); | |
4007 | |
4008 // Change context. | 4007 // Change context. |
4009 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); | 4008 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); |
4010 | 4009 |
| 4010 // Always initialize new target and number of actual arguments. |
| 4011 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); |
| 4012 __ mov(r3, Operand(instr->arity())); |
| 4013 |
4011 bool is_self_call = false; | 4014 bool is_self_call = false; |
4012 if (instr->hydrogen()->function()->IsConstant()) { | 4015 if (instr->hydrogen()->function()->IsConstant()) { |
4013 HConstant* fun_const = HConstant::cast(instr->hydrogen()->function()); | 4016 HConstant* fun_const = HConstant::cast(instr->hydrogen()->function()); |
4014 Handle<JSFunction> jsfun = | 4017 Handle<JSFunction> jsfun = |
4015 Handle<JSFunction>::cast(fun_const->handle(isolate())); | 4018 Handle<JSFunction>::cast(fun_const->handle(isolate())); |
4016 is_self_call = jsfun.is_identical_to(info()->closure()); | 4019 is_self_call = jsfun.is_identical_to(info()->closure()); |
4017 } | 4020 } |
4018 | 4021 |
4019 if (is_self_call) { | 4022 if (is_self_call) { |
4020 __ CallSelf(); | 4023 __ CallSelf(); |
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6045 __ Push(scope_info); | 6048 __ Push(scope_info); |
6046 __ push(ToRegister(instr->function())); | 6049 __ push(ToRegister(instr->function())); |
6047 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6050 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6048 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6051 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6049 } | 6052 } |
6050 | 6053 |
6051 | 6054 |
6052 #undef __ | 6055 #undef __ |
6053 } // namespace internal | 6056 } // namespace internal |
6054 } // namespace v8 | 6057 } // namespace v8 |
OLD | NEW |