| 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 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3019 | 3019 |
| 3020 __ JumpIfSmi(rax, if_false); | 3020 __ JumpIfSmi(rax, if_false); |
| 3021 __ CmpObjectType(rax, JS_FUNCTION_TYPE, rbx); | 3021 __ CmpObjectType(rax, JS_FUNCTION_TYPE, rbx); |
| 3022 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3022 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3023 Split(equal, if_true, if_false, fall_through); | 3023 Split(equal, if_true, if_false, fall_through); |
| 3024 | 3024 |
| 3025 context()->Plug(if_true, if_false); | 3025 context()->Plug(if_true, if_false); |
| 3026 } | 3026 } |
| 3027 | 3027 |
| 3028 | 3028 |
| 3029 void FullCodeGenerator::EmitIsMinusZero(CallRuntime* expr) { |
| 3030 ZoneList<Expression*>* args = expr->arguments(); |
| 3031 ASSERT(args->length() == 1); |
| 3032 |
| 3033 VisitForAccumulatorValue(args->at(0)); |
| 3034 |
| 3035 Label materialize_true, materialize_false; |
| 3036 Label* if_true = NULL; |
| 3037 Label* if_false = NULL; |
| 3038 Label* fall_through = NULL; |
| 3039 context()->PrepareTest(&materialize_true, &materialize_false, |
| 3040 &if_true, &if_false, &fall_through); |
| 3041 |
| 3042 Handle<Map> map = masm()->isolate()->factory()->heap_number_map(); |
| 3043 __ CheckMap(rax, map, if_false, DO_SMI_CHECK); |
| 3044 __ cmpl(FieldOperand(rax, HeapNumber::kExponentOffset), |
| 3045 Immediate(0x80000000)); |
| 3046 __ j(not_equal, if_false); |
| 3047 __ cmpl(FieldOperand(rax, HeapNumber::kMantissaOffset), |
| 3048 Immediate(0x00000000)); |
| 3049 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3050 Split(equal, if_true, if_false, fall_through); |
| 3051 |
| 3052 context()->Plug(if_true, if_false); |
| 3053 } |
| 3054 |
| 3055 |
| 3029 void FullCodeGenerator::EmitIsArray(CallRuntime* expr) { | 3056 void FullCodeGenerator::EmitIsArray(CallRuntime* expr) { |
| 3030 ZoneList<Expression*>* args = expr->arguments(); | 3057 ZoneList<Expression*>* args = expr->arguments(); |
| 3031 ASSERT(args->length() == 1); | 3058 ASSERT(args->length() == 1); |
| 3032 | 3059 |
| 3033 VisitForAccumulatorValue(args->at(0)); | 3060 VisitForAccumulatorValue(args->at(0)); |
| 3034 | 3061 |
| 3035 Label materialize_true, materialize_false; | 3062 Label materialize_true, materialize_false; |
| 3036 Label* if_true = NULL; | 3063 Label* if_true = NULL; |
| 3037 Label* if_false = NULL; | 3064 Label* if_false = NULL; |
| 3038 Label* fall_through = NULL; | 3065 Label* fall_through = NULL; |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3652 | 3679 |
| 3653 VisitForStackValue(args->at(0)); | 3680 VisitForStackValue(args->at(0)); |
| 3654 VisitForStackValue(args->at(1)); | 3681 VisitForStackValue(args->at(1)); |
| 3655 | 3682 |
| 3656 StringCompareStub stub; | 3683 StringCompareStub stub; |
| 3657 __ CallStub(&stub); | 3684 __ CallStub(&stub); |
| 3658 context()->Plug(rax); | 3685 context()->Plug(rax); |
| 3659 } | 3686 } |
| 3660 | 3687 |
| 3661 | 3688 |
| 3662 void FullCodeGenerator::EmitMathSin(CallRuntime* expr) { | |
| 3663 // Load the argument on the stack and call the stub. | |
| 3664 TranscendentalCacheStub stub(TranscendentalCache::SIN, | |
| 3665 TranscendentalCacheStub::TAGGED); | |
| 3666 ZoneList<Expression*>* args = expr->arguments(); | |
| 3667 ASSERT(args->length() == 1); | |
| 3668 VisitForStackValue(args->at(0)); | |
| 3669 __ CallStub(&stub); | |
| 3670 context()->Plug(rax); | |
| 3671 } | |
| 3672 | |
| 3673 | |
| 3674 void FullCodeGenerator::EmitMathCos(CallRuntime* expr) { | |
| 3675 // Load the argument on the stack and call the stub. | |
| 3676 TranscendentalCacheStub stub(TranscendentalCache::COS, | |
| 3677 TranscendentalCacheStub::TAGGED); | |
| 3678 ZoneList<Expression*>* args = expr->arguments(); | |
| 3679 ASSERT(args->length() == 1); | |
| 3680 VisitForStackValue(args->at(0)); | |
| 3681 __ CallStub(&stub); | |
| 3682 context()->Plug(rax); | |
| 3683 } | |
| 3684 | |
| 3685 | |
| 3686 void FullCodeGenerator::EmitMathTan(CallRuntime* expr) { | |
| 3687 // Load the argument on the stack and call the stub. | |
| 3688 TranscendentalCacheStub stub(TranscendentalCache::TAN, | |
| 3689 TranscendentalCacheStub::TAGGED); | |
| 3690 ZoneList<Expression*>* args = expr->arguments(); | |
| 3691 ASSERT(args->length() == 1); | |
| 3692 VisitForStackValue(args->at(0)); | |
| 3693 __ CallStub(&stub); | |
| 3694 context()->Plug(rax); | |
| 3695 } | |
| 3696 | |
| 3697 | |
| 3698 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) { | 3689 void FullCodeGenerator::EmitMathLog(CallRuntime* expr) { |
| 3699 // Load the argument on the stack and call the stub. | 3690 // Load the argument on the stack and call the stub. |
| 3700 TranscendentalCacheStub stub(TranscendentalCache::LOG, | 3691 TranscendentalCacheStub stub(TranscendentalCache::LOG, |
| 3701 TranscendentalCacheStub::TAGGED); | 3692 TranscendentalCacheStub::TAGGED); |
| 3702 ZoneList<Expression*>* args = expr->arguments(); | 3693 ZoneList<Expression*>* args = expr->arguments(); |
| 3703 ASSERT(args->length() == 1); | 3694 ASSERT(args->length() == 1); |
| 3704 VisitForStackValue(args->at(0)); | 3695 VisitForStackValue(args->at(0)); |
| 3705 __ CallStub(&stub); | 3696 __ CallStub(&stub); |
| 3706 context()->Plug(rax); | 3697 context()->Plug(rax); |
| 3707 } | 3698 } |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4960 | 4951 |
| 4961 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4952 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 4962 Assembler::target_address_at(call_target_address)); | 4953 Assembler::target_address_at(call_target_address)); |
| 4963 return OSR_AFTER_STACK_CHECK; | 4954 return OSR_AFTER_STACK_CHECK; |
| 4964 } | 4955 } |
| 4965 | 4956 |
| 4966 | 4957 |
| 4967 } } // namespace v8::internal | 4958 } } // namespace v8::internal |
| 4968 | 4959 |
| 4969 #endif // V8_TARGET_ARCH_X64 | 4960 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |