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