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 3332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3343 &if_true, &if_false, &fall_through); | 3343 &if_true, &if_false, &fall_through); |
3344 | 3344 |
3345 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3345 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3346 __ SmiTst(r0); | 3346 __ SmiTst(r0); |
3347 Split(eq, if_true, if_false, fall_through); | 3347 Split(eq, if_true, if_false, fall_through); |
3348 | 3348 |
3349 context()->Plug(if_true, if_false); | 3349 context()->Plug(if_true, if_false); |
3350 } | 3350 } |
3351 | 3351 |
3352 | 3352 |
| 3353 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) { |
| 3354 ZoneList<Expression*>* args = expr->arguments(); |
| 3355 DCHECK(args->length() == 1); |
| 3356 |
| 3357 VisitForAccumulatorValue(args->at(0)); |
| 3358 |
| 3359 Label materialize_true, materialize_false; |
| 3360 Label* if_true = NULL; |
| 3361 Label* if_false = NULL; |
| 3362 Label* fall_through = NULL; |
| 3363 context()->PrepareTest(&materialize_true, &materialize_false, |
| 3364 &if_true, &if_false, &fall_through); |
| 3365 |
| 3366 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3367 __ NonNegativeSmiTst(r0); |
| 3368 Split(eq, if_true, if_false, fall_through); |
| 3369 |
| 3370 context()->Plug(if_true, if_false); |
| 3371 } |
| 3372 |
| 3373 |
3353 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { | 3374 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { |
3354 ZoneList<Expression*>* args = expr->arguments(); | 3375 ZoneList<Expression*>* args = expr->arguments(); |
3355 DCHECK(args->length() == 1); | 3376 DCHECK(args->length() == 1); |
3356 | 3377 |
3357 VisitForAccumulatorValue(args->at(0)); | 3378 VisitForAccumulatorValue(args->at(0)); |
3358 | 3379 |
3359 Label materialize_true, materialize_false; | 3380 Label materialize_true, materialize_false; |
3360 Label* if_true = NULL; | 3381 Label* if_true = NULL; |
3361 Label* if_false = NULL; | 3382 Label* if_false = NULL; |
3362 Label* fall_through = NULL; | 3383 Label* fall_through = NULL; |
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5058 Label* if_false = NULL; | 5079 Label* if_false = NULL; |
5059 Label* fall_through = NULL; | 5080 Label* fall_through = NULL; |
5060 context()->PrepareTest(&materialize_true, &materialize_false, | 5081 context()->PrepareTest(&materialize_true, &materialize_false, |
5061 &if_true, &if_false, &fall_through); | 5082 &if_true, &if_false, &fall_through); |
5062 | 5083 |
5063 Token::Value op = expr->op(); | 5084 Token::Value op = expr->op(); |
5064 VisitForStackValue(expr->left()); | 5085 VisitForStackValue(expr->left()); |
5065 switch (op) { | 5086 switch (op) { |
5066 case Token::IN: | 5087 case Token::IN: |
5067 VisitForStackValue(expr->right()); | 5088 VisitForStackValue(expr->right()); |
5068 __ CallRuntime(Runtime::kHasProperty, 2); | 5089 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); |
5069 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 5090 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
5070 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 5091 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
5071 __ cmp(r0, ip); | 5092 __ cmp(r0, ip); |
5072 Split(eq, if_true, if_false, fall_through); | 5093 Split(eq, if_true, if_false, fall_through); |
5073 break; | 5094 break; |
5074 | 5095 |
5075 case Token::INSTANCEOF: { | 5096 case Token::INSTANCEOF: { |
5076 VisitForStackValue(expr->right()); | 5097 VisitForStackValue(expr->right()); |
5077 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); | 5098 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); |
5078 __ CallStub(&stub); | 5099 __ CallStub(&stub); |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5393 DCHECK(interrupt_address == | 5414 DCHECK(interrupt_address == |
5394 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5415 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5395 return OSR_AFTER_STACK_CHECK; | 5416 return OSR_AFTER_STACK_CHECK; |
5396 } | 5417 } |
5397 | 5418 |
5398 | 5419 |
5399 } // namespace internal | 5420 } // namespace internal |
5400 } // namespace v8 | 5421 } // namespace v8 |
5401 | 5422 |
5402 #endif // V8_TARGET_ARCH_ARM | 5423 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |