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

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

Issue 6368138: Support %_IsConstructCall in Crankshaft pipeline. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: don't check argc_bound twice Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3760 matching lines...) Expand 10 before | Expand all | Expand 10 after
3771 } else { 3771 } else {
3772 final_branch_condition = ne; 3772 final_branch_condition = ne;
3773 __ b(false_label); 3773 __ b(false_label);
3774 // A dead branch instruction will be generated after this point. 3774 // A dead branch instruction will be generated after this point.
3775 } 3775 }
3776 3776
3777 return final_branch_condition; 3777 return final_branch_condition;
3778 } 3778 }
3779 3779
3780 3780
3781 void LCodeGen::DoIsConstructCall(LIsConstructCall* instr) {
3782 Register result = ToRegister(instr->result());
3783 Register temp = ToRegister(instr->TempAt(0));
Mads Ager (chromium) 2011/02/08 07:09:44 Instead of allocating a temp here you could use sc
3784 Label true_label;
3785 Label false_label;
3786 Label done;
3787
3788 EmitIsConstructCall(result, temp);
3789 __ b(eq, &true_label);
3790
3791 __ LoadRoot(result, Heap::kFalseValueRootIndex);
3792 __ b(&done);
3793
3794 __ bind(&true_label);
3795 __ LoadRoot(result, Heap::kTrueValueRootIndex);
3796
3797 __ bind(&done);
3798 }
3799
3800
3801 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
3802 Register temp1 = ToRegister(instr->TempAt(0));
3803 Register temp2 = ToRegister(instr->TempAt(1));
Mads Ager (chromium) 2011/02/08 07:09:44 Could use scratch0().
3804 int true_block = chunk_->LookupDestination(instr->true_block_id());
3805 int false_block = chunk_->LookupDestination(instr->false_block_id());
3806
3807 EmitIsConstructCall(temp1, temp2);
3808 EmitBranch(true_block, false_block, eq);
3809 }
3810
3811
3812 void LCodeGen::EmitIsConstructCall(Register temp1, Register temp2) {
3813 // Get the frame pointer for the calling frame.
3814 __ ldr(temp1, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
3815
3816 // Skip the arguments adaptor frame if it exists.
3817 Label check_frame_marker;
3818 __ ldr(temp2, MemOperand(temp1, StandardFrameConstants::kContextOffset));
3819 __ cmp(temp2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
3820 __ b(ne, &check_frame_marker);
3821 __ ldr(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset));
3822
3823 // Check the marker in the calling frame.
3824 __ bind(&check_frame_marker);
3825 __ ldr(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset));
3826 __ cmp(temp1, Operand(Smi::FromInt(StackFrame::CONSTRUCT)));
3827 }
3828
3829
3781 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { 3830 void LCodeGen::DoLazyBailout(LLazyBailout* instr) {
3782 // No code for lazy bailout instruction. Used to capture environment after a 3831 // No code for lazy bailout instruction. Used to capture environment after a
3783 // call for populating the safepoint data with deoptimization data. 3832 // call for populating the safepoint data with deoptimization data.
3784 } 3833 }
3785 3834
3786 3835
3787 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { 3836 void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
3788 DeoptimizeIf(kNoCondition, instr->environment()); 3837 DeoptimizeIf(kNoCondition, instr->environment());
3789 } 3838 }
3790 3839
(...skipping 27 matching lines...) Expand all
3818 3867
3819 3868
3820 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 3869 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
3821 Abort("DoOsrEntry unimplemented."); 3870 Abort("DoOsrEntry unimplemented.");
3822 } 3871 }
3823 3872
3824 3873
3825 #undef __ 3874 #undef __
3826 3875
3827 } } // namespace v8::internal 3876 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | src/hydrogen.cc » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698