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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 3495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3506 __ cmp(FieldOperand(eax, HeapNumber::kExponentOffset), Immediate(0x1)); | 3506 __ cmp(FieldOperand(eax, HeapNumber::kExponentOffset), Immediate(0x1)); |
3507 __ j(no_overflow, if_false); | 3507 __ j(no_overflow, if_false); |
3508 __ cmp(FieldOperand(eax, HeapNumber::kMantissaOffset), Immediate(0x0)); | 3508 __ cmp(FieldOperand(eax, HeapNumber::kMantissaOffset), Immediate(0x0)); |
3509 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3509 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3510 Split(equal, if_true, if_false, fall_through); | 3510 Split(equal, if_true, if_false, fall_through); |
3511 | 3511 |
3512 context()->Plug(if_true, if_false); | 3512 context()->Plug(if_true, if_false); |
3513 } | 3513 } |
3514 | 3514 |
3515 | 3515 |
3516 | |
3517 void FullCodeGenerator::EmitIsArray(CallRuntime* expr) { | 3516 void FullCodeGenerator::EmitIsArray(CallRuntime* expr) { |
3518 ZoneList<Expression*>* args = expr->arguments(); | 3517 ZoneList<Expression*>* args = expr->arguments(); |
3519 DCHECK(args->length() == 1); | 3518 DCHECK(args->length() == 1); |
3520 | 3519 |
3521 VisitForAccumulatorValue(args->at(0)); | 3520 VisitForAccumulatorValue(args->at(0)); |
3522 | 3521 |
3523 Label materialize_true, materialize_false; | 3522 Label materialize_true, materialize_false; |
3524 Label* if_true = NULL; | 3523 Label* if_true = NULL; |
3525 Label* if_false = NULL; | 3524 Label* if_false = NULL; |
3526 Label* fall_through = NULL; | 3525 Label* fall_through = NULL; |
3527 context()->PrepareTest(&materialize_true, &materialize_false, | 3526 context()->PrepareTest(&materialize_true, &materialize_false, |
3528 &if_true, &if_false, &fall_through); | 3527 &if_true, &if_false, &fall_through); |
3529 | 3528 |
3530 __ JumpIfSmi(eax, if_false); | 3529 __ JumpIfSmi(eax, if_false); |
3531 __ CmpObjectType(eax, JS_ARRAY_TYPE, ebx); | 3530 __ CmpObjectType(eax, JS_ARRAY_TYPE, ebx); |
3532 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3531 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3533 Split(equal, if_true, if_false, fall_through); | 3532 Split(equal, if_true, if_false, fall_through); |
3534 | 3533 |
3535 context()->Plug(if_true, if_false); | 3534 context()->Plug(if_true, if_false); |
3536 } | 3535 } |
3537 | 3536 |
3538 | 3537 |
| 3538 void FullCodeGenerator::EmitIsTypedArray(CallRuntime* expr) { |
| 3539 ZoneList<Expression*>* args = expr->arguments(); |
| 3540 DCHECK(args->length() == 1); |
| 3541 |
| 3542 VisitForAccumulatorValue(args->at(0)); |
| 3543 |
| 3544 Label materialize_true, materialize_false; |
| 3545 Label* if_true = NULL; |
| 3546 Label* if_false = NULL; |
| 3547 Label* fall_through = NULL; |
| 3548 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3549 &if_false, &fall_through); |
| 3550 |
| 3551 __ JumpIfSmi(eax, if_false); |
| 3552 __ CmpObjectType(eax, JS_TYPED_ARRAY_TYPE, ebx); |
| 3553 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3554 Split(equal, if_true, if_false, fall_through); |
| 3555 |
| 3556 context()->Plug(if_true, if_false); |
| 3557 } |
| 3558 |
| 3559 |
3539 void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) { | 3560 void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) { |
3540 ZoneList<Expression*>* args = expr->arguments(); | 3561 ZoneList<Expression*>* args = expr->arguments(); |
3541 DCHECK(args->length() == 1); | 3562 DCHECK(args->length() == 1); |
3542 | 3563 |
3543 VisitForAccumulatorValue(args->at(0)); | 3564 VisitForAccumulatorValue(args->at(0)); |
3544 | 3565 |
3545 Label materialize_true, materialize_false; | 3566 Label materialize_true, materialize_false; |
3546 Label* if_true = NULL; | 3567 Label* if_true = NULL; |
3547 Label* if_false = NULL; | 3568 Label* if_false = NULL; |
3548 Label* fall_through = NULL; | 3569 Label* fall_through = NULL; |
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5461 Assembler::target_address_at(call_target_address, | 5482 Assembler::target_address_at(call_target_address, |
5462 unoptimized_code)); | 5483 unoptimized_code)); |
5463 return OSR_AFTER_STACK_CHECK; | 5484 return OSR_AFTER_STACK_CHECK; |
5464 } | 5485 } |
5465 | 5486 |
5466 | 5487 |
5467 } // namespace internal | 5488 } // namespace internal |
5468 } // namespace v8 | 5489 } // namespace v8 |
5469 | 5490 |
5470 #endif // V8_TARGET_ARCH_IA32 | 5491 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |