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

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

Issue 1237813002: Switch CallConstructStub to take new.target in register. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments about ARM and MIPS. Created 5 years, 5 months 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/mips64/code-stubs-mips64.cc ('k') | src/mips64/interface-descriptors-mips64.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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 3351 matching lines...) Expand 10 before | Expand all | Expand 10 after
3362 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); 3362 PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
3363 context()->Plug(v0); 3363 context()->Plug(v0);
3364 } 3364 }
3365 3365
3366 3366
3367 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { 3367 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
3368 SuperCallReference* super_call_ref = 3368 SuperCallReference* super_call_ref =
3369 expr->expression()->AsSuperCallReference(); 3369 expr->expression()->AsSuperCallReference();
3370 DCHECK_NOT_NULL(super_call_ref); 3370 DCHECK_NOT_NULL(super_call_ref);
3371 3371
3372 VariableProxy* new_target_proxy = super_call_ref->new_target_var();
3373 VisitForStackValue(new_target_proxy);
3374
3375 EmitLoadSuperConstructor(super_call_ref); 3372 EmitLoadSuperConstructor(super_call_ref);
3376 __ push(result_register()); 3373 __ push(result_register());
3377 3374
3378 // Push the arguments ("left-to-right") on the stack. 3375 // Push the arguments ("left-to-right") on the stack.
3379 ZoneList<Expression*>* args = expr->arguments(); 3376 ZoneList<Expression*>* args = expr->arguments();
3380 int arg_count = args->length(); 3377 int arg_count = args->length();
3381 for (int i = 0; i < arg_count; i++) { 3378 for (int i = 0; i < arg_count; i++) {
3382 VisitForStackValue(args->at(i)); 3379 VisitForStackValue(args->at(i));
3383 } 3380 }
3384 3381
3385 // Call the construct call builtin that handles allocation and 3382 // Call the construct call builtin that handles allocation and
3386 // constructor invocation. 3383 // constructor invocation.
3387 SetConstructCallPosition(expr); 3384 SetConstructCallPosition(expr);
3388 3385
3386 // Load original constructor into a4.
3387 VisitForAccumulatorValue(super_call_ref->new_target_var());
3388 __ mov(a4, result_register());
3389
3389 // Load function and argument count into a1 and a0. 3390 // Load function and argument count into a1 and a0.
3390 __ li(a0, Operand(arg_count)); 3391 __ li(a0, Operand(arg_count));
3391 __ ld(a1, MemOperand(sp, arg_count * kPointerSize)); 3392 __ ld(a1, MemOperand(sp, arg_count * kPointerSize));
3392 3393
3393 // Record call targets in unoptimized code. 3394 // Record call targets in unoptimized code.
3394 if (FLAG_pretenuring_call_new) { 3395 if (FLAG_pretenuring_call_new) {
3395 UNREACHABLE(); 3396 UNREACHABLE();
3396 /* TODO(dslomov): support pretenuring. 3397 /* TODO(dslomov): support pretenuring.
3397 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); 3398 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot());
3398 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == 3399 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() ==
3399 expr->CallNewFeedbackSlot().ToInt() + 1); 3400 expr->CallNewFeedbackSlot().ToInt() + 1);
3400 */ 3401 */
3401 } 3402 }
3402 3403
3403 __ li(a2, FeedbackVector()); 3404 __ li(a2, FeedbackVector());
3404 __ li(a3, Operand(SmiFromSlot(expr->CallFeedbackSlot()))); 3405 __ li(a3, Operand(SmiFromSlot(expr->CallFeedbackSlot())));
3405 3406
3406 CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET); 3407 CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET);
3407 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); 3408 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
3408 3409
3409 __ Drop(1);
3410
3411 RecordJSReturnSite(expr); 3410 RecordJSReturnSite(expr);
3412 3411
3413 EmitInitializeThisAfterSuper(super_call_ref, expr->CallFeedbackICSlot()); 3412 EmitInitializeThisAfterSuper(super_call_ref, expr->CallFeedbackICSlot());
3414 context()->Plug(v0); 3413 context()->Plug(v0);
3415 } 3414 }
3416 3415
3417 3416
3418 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { 3417 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
3419 ZoneList<Expression*>* args = expr->arguments(); 3418 ZoneList<Expression*>* args = expr->arguments();
3420 DCHECK(args->length() == 1); 3419 DCHECK(args->length() == 1);
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
4338 DCHECK(args->length() == 2); 4337 DCHECK(args->length() == 2);
4339 4338
4340 // new.target 4339 // new.target
4341 VisitForStackValue(args->at(0)); 4340 VisitForStackValue(args->at(0));
4342 4341
4343 // .this_function 4342 // .this_function
4344 VisitForStackValue(args->at(1)); 4343 VisitForStackValue(args->at(1));
4345 __ CallRuntime(Runtime::kGetPrototype, 1); 4344 __ CallRuntime(Runtime::kGetPrototype, 1);
4346 __ Push(result_register()); 4345 __ Push(result_register());
4347 4346
4347 // Load original constructor into a4.
4348 __ ld(a4, MemOperand(sp, 1 * kPointerSize));
4349
4348 // Check if the calling frame is an arguments adaptor frame. 4350 // Check if the calling frame is an arguments adaptor frame.
4349 Label adaptor_frame, args_set_up, runtime; 4351 Label adaptor_frame, args_set_up, runtime;
4350 __ ld(a2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 4352 __ ld(a2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
4351 __ ld(a3, MemOperand(a2, StandardFrameConstants::kContextOffset)); 4353 __ ld(a3, MemOperand(a2, StandardFrameConstants::kContextOffset));
4352 __ Branch(&adaptor_frame, eq, a3, 4354 __ Branch(&adaptor_frame, eq, a3,
4353 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 4355 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
4354 // default constructor has no arguments, so no adaptor frame means no args. 4356 // default constructor has no arguments, so no adaptor frame means no args.
4355 __ mov(a0, zero_reg); 4357 __ mov(a0, zero_reg);
4356 __ Branch(&args_set_up); 4358 __ Branch(&args_set_up);
4357 4359
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
5602 reinterpret_cast<uint64_t>( 5604 reinterpret_cast<uint64_t>(
5603 isolate->builtins()->OsrAfterStackCheck()->entry())); 5605 isolate->builtins()->OsrAfterStackCheck()->entry()));
5604 return OSR_AFTER_STACK_CHECK; 5606 return OSR_AFTER_STACK_CHECK;
5605 } 5607 }
5606 5608
5607 5609
5608 } // namespace internal 5610 } // namespace internal
5609 } // namespace v8 5611 } // namespace v8
5610 5612
5611 #endif // V8_TARGET_ARCH_MIPS64 5613 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/mips64/interface-descriptors-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698