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

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.cc

Issue 1459183002: [crankshaft] Pass new.target to direct function calls. (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 | « no previous file | src/crankshaft/arm64/lithium-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 #include "src/crankshaft/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.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/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 3397 matching lines...) Expand 10 before | Expand all | Expand 10 after
3408 dont_adapt_arguments || formal_parameter_count == arity; 3408 dont_adapt_arguments || formal_parameter_count == arity;
3409 3409
3410 Register function_reg = r1; 3410 Register function_reg = r1;
3411 3411
3412 LPointerMap* pointers = instr->pointer_map(); 3412 LPointerMap* pointers = instr->pointer_map();
3413 3413
3414 if (can_invoke_directly) { 3414 if (can_invoke_directly) {
3415 // Change context. 3415 // Change context.
3416 __ ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); 3416 __ ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset));
3417 3417
3418 // Always initialize r0 to the number of actual arguments. 3418 // Always initialize new target and number of actual arguments.
3419 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex);
3419 __ mov(r0, Operand(arity)); 3420 __ mov(r0, Operand(arity));
3420 3421
3421 // Invoke function. 3422 // Invoke function.
3422 __ ldr(ip, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset)); 3423 __ ldr(ip, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset));
3423 __ Call(ip); 3424 __ Call(ip);
3424 3425
3425 // Set up deoptimization. 3426 // Set up deoptimization.
3426 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); 3427 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT);
3427 } else { 3428 } else {
3428 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); 3429 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt);
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
3790 } 3791 }
3791 generator.AfterCall(); 3792 generator.AfterCall();
3792 } 3793 }
3793 } 3794 }
3794 3795
3795 3796
3796 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { 3797 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) {
3797 DCHECK(ToRegister(instr->function()).is(r1)); 3798 DCHECK(ToRegister(instr->function()).is(r1));
3798 DCHECK(ToRegister(instr->result()).is(r0)); 3799 DCHECK(ToRegister(instr->result()).is(r0));
3799 3800
3800 __ mov(r0, Operand(instr->arity()));
3801
3802 // Change context. 3801 // Change context.
3803 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); 3802 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
3804 3803
3804 // Always initialize new target and number of actual arguments.
3805 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex);
3806 __ mov(r0, Operand(instr->arity()));
3807
3805 // Load the code entry address 3808 // Load the code entry address
3806 __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); 3809 __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
3807 __ Call(ip); 3810 __ Call(ip);
3808 3811
3809 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); 3812 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT);
3810 } 3813 }
3811 3814
3812 3815
3813 void LCodeGen::DoCallFunction(LCallFunction* instr) { 3816 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3814 DCHECK(ToRegister(instr->context()).is(cp)); 3817 DCHECK(ToRegister(instr->context()).is(cp));
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after
5772 __ push(ToRegister(instr->function())); 5775 __ push(ToRegister(instr->function()));
5773 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5776 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5774 RecordSafepoint(Safepoint::kNoLazyDeopt); 5777 RecordSafepoint(Safepoint::kNoLazyDeopt);
5775 } 5778 }
5776 5779
5777 5780
5778 #undef __ 5781 #undef __
5779 5782
5780 } // namespace internal 5783 } // namespace internal
5781 } // namespace v8 5784 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698