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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.cc

Issue 1419813010: [runtime] Remove the very dangerous %_CallFunction intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/debug/mirrors.js ('k') | src/full-codegen/arm64/full-codegen-arm64.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 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
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 3849 matching lines...) Expand 10 before | Expand all | Expand 10 after
3860 // Call the target. 3860 // Call the target.
3861 __ mov(r0, Operand(argc)); 3861 __ mov(r0, Operand(argc));
3862 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); 3862 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
3863 // Restore context register. 3863 // Restore context register.
3864 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 3864 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3865 // Discard the function left on TOS. 3865 // Discard the function left on TOS.
3866 context()->DropAndPlug(1, r0); 3866 context()->DropAndPlug(1, r0);
3867 } 3867 }
3868 3868
3869 3869
3870 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) {
3871 ZoneList<Expression*>* args = expr->arguments();
3872 DCHECK(args->length() >= 2);
3873
3874 int arg_count = args->length() - 2; // 2 ~ receiver and function.
3875 for (int i = 0; i < arg_count + 1; i++) {
3876 VisitForStackValue(args->at(i));
3877 }
3878 VisitForAccumulatorValue(args->last()); // Function.
3879
3880 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
3881 Label runtime, done;
3882 // Check for non-function argument (including proxy).
3883 __ JumpIfSmi(r0, &runtime);
3884 __ CompareObjectType(r0, r1, r1, JS_FUNCTION_TYPE);
3885 __ b(ne, &runtime);
3886
3887 // InvokeFunction requires the function in r1. Move it in there.
3888 __ mov(r1, result_register());
3889 ParameterCount count(arg_count);
3890 __ InvokeFunction(r1, count, CALL_FUNCTION, NullCallWrapper());
3891 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3892 __ jmp(&done);
3893
3894 __ bind(&runtime);
3895 __ push(r0);
3896 __ CallRuntime(Runtime::kCallFunction, args->length());
3897 __ bind(&done);
3898
3899 context()->Plug(r0);
3900 }
3901
3902
3903 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { 3870 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) {
3904 ZoneList<Expression*>* args = expr->arguments(); 3871 ZoneList<Expression*>* args = expr->arguments();
3905 DCHECK(args->length() == 2); 3872 DCHECK(args->length() == 2);
3906 3873
3907 // Evaluate new.target and super constructor. 3874 // Evaluate new.target and super constructor.
3908 VisitForStackValue(args->at(0)); 3875 VisitForStackValue(args->at(0));
3909 VisitForStackValue(args->at(1)); 3876 VisitForStackValue(args->at(1));
3910 3877
3911 // Load original constructor into r3. 3878 // Load original constructor into r3.
3912 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); 3879 __ ldr(r3, MemOperand(sp, 1 * kPointerSize));
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
5144 DCHECK(interrupt_address == 5111 DCHECK(interrupt_address ==
5145 isolate->builtins()->OsrAfterStackCheck()->entry()); 5112 isolate->builtins()->OsrAfterStackCheck()->entry());
5146 return OSR_AFTER_STACK_CHECK; 5113 return OSR_AFTER_STACK_CHECK;
5147 } 5114 }
5148 5115
5149 5116
5150 } // namespace internal 5117 } // namespace internal
5151 } // namespace v8 5118 } // namespace v8
5152 5119
5153 #endif // V8_TARGET_ARCH_ARM 5120 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/debug/mirrors.js ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698