Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 3559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3570 } else { | 3570 } else { |
| 3571 final_branch_condition = not_equal; | 3571 final_branch_condition = not_equal; |
| 3572 __ jmp(false_label); | 3572 __ jmp(false_label); |
| 3573 // A dead branch instruction will be generated after this point. | 3573 // A dead branch instruction will be generated after this point. |
| 3574 } | 3574 } |
| 3575 | 3575 |
| 3576 return final_branch_condition; | 3576 return final_branch_condition; |
| 3577 } | 3577 } |
| 3578 | 3578 |
| 3579 | 3579 |
| 3580 void LCodeGen::DoIsConstructCall(LIsConstructCall* instr) { | |
| 3581 Register result = ToRegister(instr->result()); | |
| 3582 Label true_label; | |
|
Mads Ager (chromium)
2011/02/08 07:09:44
Make these NearLabel?
| |
| 3583 Label false_label; | |
| 3584 NearLabel done; | |
| 3585 | |
| 3586 EmitIsConstructCall(result); | |
| 3587 __ j(equal, &true_label); | |
| 3588 | |
| 3589 __ mov(result, Factory::false_value()); | |
| 3590 __ jmp(&done); | |
| 3591 | |
| 3592 __ bind(&true_label); | |
| 3593 __ mov(result, Factory::true_value()); | |
| 3594 | |
| 3595 __ bind(&done); | |
| 3596 } | |
| 3597 | |
| 3598 | |
| 3599 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | |
| 3600 Register temp = ToRegister(instr->TempAt(0)); | |
| 3601 int true_block = chunk_->LookupDestination(instr->true_block_id()); | |
| 3602 int false_block = chunk_->LookupDestination(instr->false_block_id()); | |
| 3603 | |
| 3604 EmitIsConstructCall(temp); | |
| 3605 EmitBranch(true_block, false_block, equal); | |
| 3606 } | |
| 3607 | |
| 3608 | |
| 3609 void LCodeGen::EmitIsConstructCall(Register temp) { | |
| 3610 // Get the frame pointer for the calling frame. | |
| 3611 __ mov(temp, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | |
| 3612 | |
| 3613 // Skip the arguments adaptor frame if it exists. | |
| 3614 Label check_frame_marker; | |
| 3615 __ cmp(Operand(temp, StandardFrameConstants::kContextOffset), | |
| 3616 Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | |
| 3617 __ j(not_equal, &check_frame_marker); | |
| 3618 __ mov(temp, Operand(temp, StandardFrameConstants::kCallerFPOffset)); | |
| 3619 | |
| 3620 // Check the marker in the calling frame. | |
| 3621 __ bind(&check_frame_marker); | |
| 3622 __ cmp(Operand(temp, StandardFrameConstants::kMarkerOffset), | |
| 3623 Immediate(Smi::FromInt(StackFrame::CONSTRUCT))); | |
| 3624 } | |
| 3625 | |
| 3626 | |
| 3580 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { | 3627 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { |
| 3581 // No code for lazy bailout instruction. Used to capture environment after a | 3628 // No code for lazy bailout instruction. Used to capture environment after a |
| 3582 // call for populating the safepoint data with deoptimization data. | 3629 // call for populating the safepoint data with deoptimization data. |
| 3583 } | 3630 } |
| 3584 | 3631 |
| 3585 | 3632 |
| 3586 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { | 3633 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { |
| 3587 DeoptimizeIf(no_condition, instr->environment()); | 3634 DeoptimizeIf(no_condition, instr->environment()); |
| 3588 } | 3635 } |
| 3589 | 3636 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3637 ASSERT(osr_pc_offset_ == -1); | 3684 ASSERT(osr_pc_offset_ == -1); |
| 3638 osr_pc_offset_ = masm()->pc_offset(); | 3685 osr_pc_offset_ = masm()->pc_offset(); |
| 3639 } | 3686 } |
| 3640 | 3687 |
| 3641 | 3688 |
| 3642 #undef __ | 3689 #undef __ |
| 3643 | 3690 |
| 3644 } } // namespace v8::internal | 3691 } } // namespace v8::internal |
| 3645 | 3692 |
| 3646 #endif // V8_TARGET_ARCH_IA32 | 3693 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |