OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3036 context()->PrepareTest(&materialize_true, &materialize_false, | 3036 context()->PrepareTest(&materialize_true, &materialize_false, |
3037 &if_true, &if_false, &fall_through); | 3037 &if_true, &if_false, &fall_through); |
3038 | 3038 |
3039 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3039 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3040 __ TestAndSplit(x0, kSmiTagMask, if_true, if_false, fall_through); | 3040 __ TestAndSplit(x0, kSmiTagMask, if_true, if_false, fall_through); |
3041 | 3041 |
3042 context()->Plug(if_true, if_false); | 3042 context()->Plug(if_true, if_false); |
3043 } | 3043 } |
3044 | 3044 |
3045 | 3045 |
3046 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) { | |
3047 ZoneList<Expression*>* args = expr->arguments(); | |
3048 DCHECK(args->length() == 1); | |
3049 | |
3050 VisitForAccumulatorValue(args->at(0)); | |
3051 | |
3052 Label materialize_true, materialize_false; | |
3053 Label* if_true = NULL; | |
3054 Label* if_false = NULL; | |
3055 Label* fall_through = NULL; | |
3056 context()->PrepareTest(&materialize_true, &materialize_false, | |
3057 &if_true, &if_false, &fall_through); | |
3058 | |
3059 uint64_t sign_mask = V8_UINT64_C(1) << (kSmiShift + kSmiValueSize - 1); | |
3060 | |
3061 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
3062 __ TestAndSplit(x0, kSmiTagMask | sign_mask, if_true, if_false, fall_through); | |
3063 | |
3064 context()->Plug(if_true, if_false); | |
3065 } | |
3066 | |
3067 | |
3068 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { | 3046 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { |
3069 ZoneList<Expression*>* args = expr->arguments(); | 3047 ZoneList<Expression*>* args = expr->arguments(); |
3070 DCHECK(args->length() == 1); | 3048 DCHECK(args->length() == 1); |
3071 | 3049 |
3072 VisitForAccumulatorValue(args->at(0)); | 3050 VisitForAccumulatorValue(args->at(0)); |
3073 | 3051 |
3074 Label materialize_true, materialize_false; | 3052 Label materialize_true, materialize_false; |
3075 Label* if_true = NULL; | 3053 Label* if_true = NULL; |
3076 Label* if_false = NULL; | 3054 Label* if_false = NULL; |
3077 Label* fall_through = NULL; | 3055 Label* fall_through = NULL; |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4784 Label* if_false = NULL; | 4762 Label* if_false = NULL; |
4785 Label* fall_through = NULL; | 4763 Label* fall_through = NULL; |
4786 context()->PrepareTest(&materialize_true, &materialize_false, | 4764 context()->PrepareTest(&materialize_true, &materialize_false, |
4787 &if_true, &if_false, &fall_through); | 4765 &if_true, &if_false, &fall_through); |
4788 | 4766 |
4789 Token::Value op = expr->op(); | 4767 Token::Value op = expr->op(); |
4790 VisitForStackValue(expr->left()); | 4768 VisitForStackValue(expr->left()); |
4791 switch (op) { | 4769 switch (op) { |
4792 case Token::IN: | 4770 case Token::IN: |
4793 VisitForStackValue(expr->right()); | 4771 VisitForStackValue(expr->right()); |
4794 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); | 4772 __ CallRuntime(Runtime::kHasProperty, 2); |
4795 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 4773 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
4796 __ CompareRoot(x0, Heap::kTrueValueRootIndex); | 4774 __ CompareRoot(x0, Heap::kTrueValueRootIndex); |
4797 Split(eq, if_true, if_false, fall_through); | 4775 Split(eq, if_true, if_false, fall_through); |
4798 break; | 4776 break; |
4799 | 4777 |
4800 case Token::INSTANCEOF: { | 4778 case Token::INSTANCEOF: { |
4801 VisitForStackValue(expr->right()); | 4779 VisitForStackValue(expr->right()); |
4802 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); | 4780 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); |
4803 __ CallStub(&stub); | 4781 __ CallStub(&stub); |
4804 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4782 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5400 } | 5378 } |
5401 | 5379 |
5402 return INTERRUPT; | 5380 return INTERRUPT; |
5403 } | 5381 } |
5404 | 5382 |
5405 | 5383 |
5406 } // namespace internal | 5384 } // namespace internal |
5407 } // namespace v8 | 5385 } // namespace v8 |
5408 | 5386 |
5409 #endif // V8_TARGET_ARCH_ARM64 | 5387 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |