| 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 3515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3526 DeoptimizeIf(ne, instr->environment()); | 3526 DeoptimizeIf(ne, instr->environment()); |
| 3527 // Retrieve the result. | 3527 // Retrieve the result. |
| 3528 __ vmov(result_reg, single_scratch); | 3528 __ vmov(result_reg, single_scratch); |
| 3529 } | 3529 } |
| 3530 __ bind(&done); | 3530 __ bind(&done); |
| 3531 } | 3531 } |
| 3532 | 3532 |
| 3533 | 3533 |
| 3534 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { | 3534 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
| 3535 LOperand* input = instr->InputAt(0); | 3535 LOperand* input = instr->InputAt(0); |
| 3536 ASSERT(input->IsRegister()); | |
| 3537 __ tst(ToRegister(input), Operand(kSmiTagMask)); | 3536 __ tst(ToRegister(input), Operand(kSmiTagMask)); |
| 3538 DeoptimizeIf(instr->condition(), instr->environment()); | 3537 DeoptimizeIf(ne, instr->environment()); |
| 3538 } |
| 3539 |
| 3540 |
| 3541 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
| 3542 LOperand* input = instr->InputAt(0); |
| 3543 __ tst(ToRegister(input), Operand(kSmiTagMask)); |
| 3544 DeoptimizeIf(eq, instr->environment()); |
| 3539 } | 3545 } |
| 3540 | 3546 |
| 3541 | 3547 |
| 3542 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { | 3548 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { |
| 3543 Register input = ToRegister(instr->InputAt(0)); | 3549 Register input = ToRegister(instr->InputAt(0)); |
| 3544 Register scratch = scratch0(); | 3550 Register scratch = scratch0(); |
| 3545 InstanceType first = instr->hydrogen()->first(); | 3551 InstanceType first = instr->hydrogen()->first(); |
| 3546 InstanceType last = instr->hydrogen()->last(); | 3552 InstanceType last = instr->hydrogen()->last(); |
| 3547 | 3553 |
| 3548 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); | 3554 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3721 __ str(r3, FieldMemOperand(r0, size - kPointerSize)); | 3727 __ str(r3, FieldMemOperand(r0, size - kPointerSize)); |
| 3722 } | 3728 } |
| 3723 } | 3729 } |
| 3724 | 3730 |
| 3725 | 3731 |
| 3726 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 3732 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
| 3727 // Use the fast case closure allocation code that allocates in new | 3733 // Use the fast case closure allocation code that allocates in new |
| 3728 // space for nested functions that don't need literals cloning. | 3734 // space for nested functions that don't need literals cloning. |
| 3729 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); | 3735 Handle<SharedFunctionInfo> shared_info = instr->shared_info(); |
| 3730 bool pretenure = instr->hydrogen()->pretenure(); | 3736 bool pretenure = instr->hydrogen()->pretenure(); |
| 3731 if (shared_info->num_literals() == 0 && !pretenure) { | 3737 if (!pretenure && shared_info->num_literals() == 0) { |
| 3732 FastNewClosureStub stub; | 3738 FastNewClosureStub stub( |
| 3739 shared_info->strict_mode() ? kStrictMode : kNonStrictMode); |
| 3733 __ mov(r1, Operand(shared_info)); | 3740 __ mov(r1, Operand(shared_info)); |
| 3734 __ push(r1); | 3741 __ push(r1); |
| 3735 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3742 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3736 } else { | 3743 } else { |
| 3737 __ mov(r2, Operand(shared_info)); | 3744 __ mov(r2, Operand(shared_info)); |
| 3738 __ mov(r1, Operand(pretenure | 3745 __ mov(r1, Operand(pretenure |
| 3739 ? factory()->true_value() | 3746 ? factory()->true_value() |
| 3740 : factory()->false_value())); | 3747 : factory()->false_value())); |
| 3741 __ Push(cp, r2, r1); | 3748 __ Push(cp, r2, r1); |
| 3742 CallRuntime(Runtime::kNewClosure, 3, instr); | 3749 CallRuntime(Runtime::kNewClosure, 3, instr); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3958 ASSERT(!environment->HasBeenRegistered()); | 3965 ASSERT(!environment->HasBeenRegistered()); |
| 3959 RegisterEnvironmentForDeoptimization(environment); | 3966 RegisterEnvironmentForDeoptimization(environment); |
| 3960 ASSERT(osr_pc_offset_ == -1); | 3967 ASSERT(osr_pc_offset_ == -1); |
| 3961 osr_pc_offset_ = masm()->pc_offset(); | 3968 osr_pc_offset_ = masm()->pc_offset(); |
| 3962 } | 3969 } |
| 3963 | 3970 |
| 3964 | 3971 |
| 3965 #undef __ | 3972 #undef __ |
| 3966 | 3973 |
| 3967 } } // namespace v8::internal | 3974 } } // namespace v8::internal |
| OLD | NEW |