OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 3262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3273 &if_true, &if_false, &fall_through); | 3273 &if_true, &if_false, &fall_through); |
3274 | 3274 |
3275 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3275 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3276 __ SmiTst(r0); | 3276 __ SmiTst(r0); |
3277 Split(eq, if_true, if_false, fall_through); | 3277 Split(eq, if_true, if_false, fall_through); |
3278 | 3278 |
3279 context()->Plug(if_true, if_false); | 3279 context()->Plug(if_true, if_false); |
3280 } | 3280 } |
3281 | 3281 |
3282 | 3282 |
3283 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) { | |
3284 ZoneList<Expression*>* args = expr->arguments(); | |
3285 DCHECK(args->length() == 1); | |
3286 | |
3287 VisitForAccumulatorValue(args->at(0)); | |
3288 | |
3289 Label materialize_true, materialize_false; | |
3290 Label* if_true = NULL; | |
3291 Label* if_false = NULL; | |
3292 Label* fall_through = NULL; | |
3293 context()->PrepareTest(&materialize_true, &materialize_false, | |
3294 &if_true, &if_false, &fall_through); | |
3295 | |
3296 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
3297 __ NonNegativeSmiTst(r0); | |
3298 Split(eq, if_true, if_false, fall_through); | |
3299 | |
3300 context()->Plug(if_true, if_false); | |
3301 } | |
3302 | |
3303 | |
3304 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { | 3283 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { |
3305 ZoneList<Expression*>* args = expr->arguments(); | 3284 ZoneList<Expression*>* args = expr->arguments(); |
3306 DCHECK(args->length() == 1); | 3285 DCHECK(args->length() == 1); |
3307 | 3286 |
3308 VisitForAccumulatorValue(args->at(0)); | 3287 VisitForAccumulatorValue(args->at(0)); |
3309 | 3288 |
3310 Label materialize_true, materialize_false; | 3289 Label materialize_true, materialize_false; |
3311 Label* if_true = NULL; | 3290 Label* if_true = NULL; |
3312 Label* if_false = NULL; | 3291 Label* if_false = NULL; |
3313 Label* fall_through = NULL; | 3292 Label* fall_through = NULL; |
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5035 Label* if_false = NULL; | 5014 Label* if_false = NULL; |
5036 Label* fall_through = NULL; | 5015 Label* fall_through = NULL; |
5037 context()->PrepareTest(&materialize_true, &materialize_false, | 5016 context()->PrepareTest(&materialize_true, &materialize_false, |
5038 &if_true, &if_false, &fall_through); | 5017 &if_true, &if_false, &fall_through); |
5039 | 5018 |
5040 Token::Value op = expr->op(); | 5019 Token::Value op = expr->op(); |
5041 VisitForStackValue(expr->left()); | 5020 VisitForStackValue(expr->left()); |
5042 switch (op) { | 5021 switch (op) { |
5043 case Token::IN: | 5022 case Token::IN: |
5044 VisitForStackValue(expr->right()); | 5023 VisitForStackValue(expr->right()); |
5045 __ InvokeBuiltin(Context::IN_BUILTIN_INDEX, CALL_FUNCTION); | 5024 __ CallRuntime(Runtime::kHasProperty, 2); |
5046 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 5025 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
5047 __ CompareRoot(r0, Heap::kTrueValueRootIndex); | 5026 __ CompareRoot(r0, Heap::kTrueValueRootIndex); |
5048 Split(eq, if_true, if_false, fall_through); | 5027 Split(eq, if_true, if_false, fall_through); |
5049 break; | 5028 break; |
5050 | 5029 |
5051 case Token::INSTANCEOF: { | 5030 case Token::INSTANCEOF: { |
5052 VisitForAccumulatorValue(expr->right()); | 5031 VisitForAccumulatorValue(expr->right()); |
5053 __ pop(r1); | 5032 __ pop(r1); |
5054 InstanceOfStub stub(isolate()); | 5033 InstanceOfStub stub(isolate()); |
5055 __ CallStub(&stub); | 5034 __ CallStub(&stub); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5369 DCHECK(interrupt_address == | 5348 DCHECK(interrupt_address == |
5370 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5349 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5371 return OSR_AFTER_STACK_CHECK; | 5350 return OSR_AFTER_STACK_CHECK; |
5372 } | 5351 } |
5373 | 5352 |
5374 | 5353 |
5375 } // namespace internal | 5354 } // namespace internal |
5376 } // namespace v8 | 5355 } // namespace v8 |
5377 | 5356 |
5378 #endif // V8_TARGET_ARCH_ARM | 5357 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |