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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 3850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3861 // Call the target. | 3861 // Call the target. |
3862 __ mov(r3, Operand(argc)); | 3862 __ mov(r3, Operand(argc)); |
3863 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 3863 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
3864 // Restore context register. | 3864 // Restore context register. |
3865 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3865 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
3866 // Discard the function left on TOS. | 3866 // Discard the function left on TOS. |
3867 context()->DropAndPlug(1, r3); | 3867 context()->DropAndPlug(1, r3); |
3868 } | 3868 } |
3869 | 3869 |
3870 | 3870 |
3871 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { | |
3872 ZoneList<Expression*>* args = expr->arguments(); | |
3873 DCHECK(args->length() >= 2); | |
3874 | |
3875 int arg_count = args->length() - 2; // 2 ~ receiver and function. | |
3876 for (int i = 0; i < arg_count + 1; i++) { | |
3877 VisitForStackValue(args->at(i)); | |
3878 } | |
3879 VisitForAccumulatorValue(args->last()); // Function. | |
3880 | |
3881 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | |
3882 Label runtime, done; | |
3883 // Check for non-function argument (including proxy). | |
3884 __ JumpIfSmi(r3, &runtime); | |
3885 __ CompareObjectType(r3, r4, r4, JS_FUNCTION_TYPE); | |
3886 __ bne(&runtime); | |
3887 | |
3888 // InvokeFunction requires the function in r4. Move it in there. | |
3889 __ mr(r4, result_register()); | |
3890 ParameterCount count(arg_count); | |
3891 __ InvokeFunction(r4, count, CALL_FUNCTION, NullCallWrapper()); | |
3892 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
3893 __ b(&done); | |
3894 | |
3895 __ bind(&runtime); | |
3896 __ push(r3); | |
3897 __ CallRuntime(Runtime::kCallFunction, args->length()); | |
3898 __ bind(&done); | |
3899 | |
3900 context()->Plug(r3); | |
3901 } | |
3902 | |
3903 | |
3904 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { | 3871 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { |
3905 ZoneList<Expression*>* args = expr->arguments(); | 3872 ZoneList<Expression*>* args = expr->arguments(); |
3906 DCHECK(args->length() == 2); | 3873 DCHECK(args->length() == 2); |
3907 | 3874 |
3908 // Evaluate new.target. | 3875 // Evaluate new.target. |
3909 VisitForStackValue(args->at(0)); | 3876 VisitForStackValue(args->at(0)); |
3910 | 3877 |
3911 // Evaluate super constructor (to stack and r4). | 3878 // Evaluate super constructor (to stack and r4). |
3912 VisitForAccumulatorValue(args->at(1)); | 3879 VisitForAccumulatorValue(args->at(1)); |
3913 __ push(result_register()); | 3880 __ push(result_register()); |
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5095 return ON_STACK_REPLACEMENT; | 5062 return ON_STACK_REPLACEMENT; |
5096 } | 5063 } |
5097 | 5064 |
5098 DCHECK(interrupt_address == | 5065 DCHECK(interrupt_address == |
5099 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5066 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5100 return OSR_AFTER_STACK_CHECK; | 5067 return OSR_AFTER_STACK_CHECK; |
5101 } | 5068 } |
5102 } // namespace internal | 5069 } // namespace internal |
5103 } // namespace v8 | 5070 } // namespace v8 |
5104 #endif // V8_TARGET_ARCH_PPC | 5071 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |