| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3126 __ JumpIfSmi(v0, if_false); | 3126 __ JumpIfSmi(v0, if_false); |
| 3127 __ GetObjectType(v0, a1, a2); | 3127 __ GetObjectType(v0, a1, a2); |
| 3128 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3128 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3129 __ Branch(if_true, eq, a2, Operand(JS_FUNCTION_TYPE)); | 3129 __ Branch(if_true, eq, a2, Operand(JS_FUNCTION_TYPE)); |
| 3130 __ Branch(if_false); | 3130 __ Branch(if_false); |
| 3131 | 3131 |
| 3132 context()->Plug(if_true, if_false); | 3132 context()->Plug(if_true, if_false); |
| 3133 } | 3133 } |
| 3134 | 3134 |
| 3135 | 3135 |
| 3136 void FullCodeGenerator::EmitIsMinusZero(CallRuntime* expr) { |
| 3137 ZoneList<Expression*>* args = expr->arguments(); |
| 3138 ASSERT(args->length() == 1); |
| 3139 |
| 3140 VisitForAccumulatorValue(args->at(0)); |
| 3141 |
| 3142 Label materialize_true, materialize_false; |
| 3143 Label* if_true = NULL; |
| 3144 Label* if_false = NULL; |
| 3145 Label* fall_through = NULL; |
| 3146 context()->PrepareTest(&materialize_true, &materialize_false, |
| 3147 &if_true, &if_false, &fall_through); |
| 3148 |
| 3149 __ CheckMap(v0, a1, Heap::kHeapNumberMapRootIndex, if_false, DO_SMI_CHECK); |
| 3150 __ lw(a2, FieldMemOperand(v0, HeapNumber::kExponentOffset)); |
| 3151 __ lw(a1, FieldMemOperand(v0, HeapNumber::kMantissaOffset)); |
| 3152 __ li(t0, 0x80000000); |
| 3153 Label not_nan; |
| 3154 __ Branch(¬_nan, ne, a2, Operand(t0)); |
| 3155 __ mov(t0, zero_reg); |
| 3156 __ mov(a2, a1); |
| 3157 __ bind(¬_nan); |
| 3158 |
| 3159 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3160 Split(eq, a2, Operand(t0), if_true, if_false, fall_through); |
| 3161 |
| 3162 context()->Plug(if_true, if_false); |
| 3163 } |
| 3164 |
| 3165 |
| 3136 void FullCodeGenerator::EmitIsArray(CallRuntime* expr) { | 3166 void FullCodeGenerator::EmitIsArray(CallRuntime* expr) { |
| 3137 ZoneList<Expression*>* args = expr->arguments(); | 3167 ZoneList<Expression*>* args = expr->arguments(); |
| 3138 ASSERT(args->length() == 1); | 3168 ASSERT(args->length() == 1); |
| 3139 | 3169 |
| 3140 VisitForAccumulatorValue(args->at(0)); | 3170 VisitForAccumulatorValue(args->at(0)); |
| 3141 | 3171 |
| 3142 Label materialize_true, materialize_false; | 3172 Label materialize_true, materialize_false; |
| 3143 Label* if_true = NULL; | 3173 Label* if_true = NULL; |
| 3144 Label* if_false = NULL; | 3174 Label* if_false = NULL; |
| 3145 Label* fall_through = NULL; | 3175 Label* fall_through = NULL; |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3733 generator.GenerateSlow(masm_, call_helper); | 3763 generator.GenerateSlow(masm_, call_helper); |
| 3734 | 3764 |
| 3735 __ bind(&done); | 3765 __ bind(&done); |
| 3736 context()->Plug(result); | 3766 context()->Plug(result); |
| 3737 } | 3767 } |
| 3738 | 3768 |
| 3739 | 3769 |
| 3740 void FullCodeGenerator::EmitStringAdd(CallRuntime* expr) { | 3770 void FullCodeGenerator::EmitStringAdd(CallRuntime* expr) { |
| 3741 ZoneList<Expression*>* args = expr->arguments(); | 3771 ZoneList<Expression*>* args = expr->arguments(); |
| 3742 ASSERT_EQ(2, args->length()); | 3772 ASSERT_EQ(2, args->length()); |
| 3743 VisitForStackValue(args->at(0)); | 3773 if (FLAG_new_string_add) { |
| 3744 VisitForStackValue(args->at(1)); | 3774 VisitForStackValue(args->at(0)); |
| 3775 VisitForAccumulatorValue(args->at(1)); |
| 3745 | 3776 |
| 3746 StringAddStub stub(STRING_ADD_CHECK_BOTH); | 3777 __ pop(a1); |
| 3747 __ CallStub(&stub); | 3778 NewStringAddStub stub(STRING_ADD_CHECK_BOTH, NOT_TENURED); |
| 3779 __ CallStub(&stub); |
| 3780 } else { |
| 3781 VisitForStackValue(args->at(0)); |
| 3782 VisitForStackValue(args->at(1)); |
| 3783 |
| 3784 StringAddStub stub(STRING_ADD_CHECK_BOTH); |
| 3785 __ CallStub(&stub); |
| 3786 } |
| 3748 context()->Plug(v0); | 3787 context()->Plug(v0); |
| 3749 } | 3788 } |
| 3750 | 3789 |
| 3751 | 3790 |
| 3752 void FullCodeGenerator::EmitStringCompare(CallRuntime* expr) { | 3791 void FullCodeGenerator::EmitStringCompare(CallRuntime* expr) { |
| 3753 ZoneList<Expression*>* args = expr->arguments(); | 3792 ZoneList<Expression*>* args = expr->arguments(); |
| 3754 ASSERT_EQ(2, args->length()); | 3793 ASSERT_EQ(2, args->length()); |
| 3755 | 3794 |
| 3756 VisitForStackValue(args->at(0)); | 3795 VisitForStackValue(args->at(0)); |
| 3757 VisitForStackValue(args->at(1)); | 3796 VisitForStackValue(args->at(1)); |
| 3758 | 3797 |
| 3759 StringCompareStub stub; | 3798 StringCompareStub stub; |
| 3760 __ CallStub(&stub); | 3799 __ CallStub(&stub); |
| 3761 context()->Plug(v0); | 3800 context()->Plug(v0); |
| 3762 } | 3801 } |
| 3763 | 3802 |
| 3764 | 3803 |
| 3765 void FullCodeGenerator::EmitMathSin(CallRuntime* expr) { | |
| 3766 // Load the argument on the stack and call the stub. | |
| 3767 TranscendentalCacheStub stub(TranscendentalCache::SIN, | |
| 3768 TranscendentalCacheStub::TAGGED); | |
| 3769 ZoneList<Expression*>* args = expr->arguments(); | |
| 3770 ASSERT(args->length() == 1); | |
| 3771 VisitForStackValue(args->at(0)); | |
| 3772 __ mov(a0, result_register()); // Stub requires parameter in a0 and on tos. | |
| 3773 __ CallStub(&stub); | |
| 3774 context()->Plug(v0); | |
| 3775 } | |
| 3776 | |
| 3777 | |
| 3778 void FullCodeGenerator::EmitMathCos(CallRuntime* expr) { | |
| 3779 // Load the argument on the stack and call the stub. | |
| 3780 TranscendentalCacheStub stub(TranscendentalCache::COS, | |
| 3781 TranscendentalCacheStub::TAGGED); | |
| 3782 ZoneList<Expression*>* args = expr->arguments(); | |
| 3783 ASSERT(args->length() == 1); | |
| 3784 VisitForStackValue(args->at(0)); | |
| 3785 __ mov(a0, result_register()); // Stub requires parameter in a0 and on tos. | |
| 3786 __ CallStub(&stub); | |
| 3787 context()->Plug(v0); | |
| 3788 } | |
| 3789 | |
| 3790 | |
| 3791 void FullCodeGenerator::EmitMathTan(CallRuntime* expr) { | |
| 3792 // Load the argument on the stack and call the stub. | |
| 3793 TranscendentalCacheStub stub(TranscendentalCache::TAN, | |
| 3794 TranscendentalCacheStub::TAGGED); | |
| 3795 ZoneList<Expression*>* args = expr->arguments(); | |
| 3796 ASSERT(args->length() == 1); | |
| 3797 VisitForStackValue(args->at(0)); | |
| 3798 __ mov(a0, result_register()); // Stub requires parameter in a0 and on tos. | |
| 3799 __ CallStub(&stub); | |
| 3800 context()->Plug(v0); | |
| 3801 } | |
| 3802 | |
| 3803 | |
| 3804 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) { | 3804 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) { |
| 3805 // Load the argument on the stack and call the stub. | 3805 // Load the argument on the stack and call the stub. |
| 3806 TranscendentalCacheStub stub(TranscendentalCache::LOG, | 3806 TranscendentalCacheStub stub(TranscendentalCache::LOG, |
| 3807 TranscendentalCacheStub::TAGGED); | 3807 TranscendentalCacheStub::TAGGED); |
| 3808 ZoneList<Expression*>* args = expr->arguments(); | 3808 ZoneList<Expression*>* args = expr->arguments(); |
| 3809 ASSERT(args->length() == 1); | 3809 ASSERT(args->length() == 1); |
| 3810 VisitForStackValue(args->at(0)); | 3810 VisitForStackValue(args->at(0)); |
| 3811 __ mov(a0, result_register()); // Stub requires parameter in a0 and on tos. | 3811 __ mov(a0, result_register()); // Stub requires parameter in a0 and on tos. |
| 3812 __ CallStub(&stub); | 3812 __ CallStub(&stub); |
| 3813 context()->Plug(v0); | 3813 context()->Plug(v0); |
| (...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5016 Assembler::target_address_at(pc_immediate_load_address)) == | 5016 Assembler::target_address_at(pc_immediate_load_address)) == |
| 5017 reinterpret_cast<uint32_t>( | 5017 reinterpret_cast<uint32_t>( |
| 5018 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5018 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5019 return OSR_AFTER_STACK_CHECK; | 5019 return OSR_AFTER_STACK_CHECK; |
| 5020 } | 5020 } |
| 5021 | 5021 |
| 5022 | 5022 |
| 5023 } } // namespace v8::internal | 5023 } } // namespace v8::internal |
| 5024 | 5024 |
| 5025 #endif // V8_TARGET_ARCH_MIPS | 5025 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |