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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 3486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3497 __ cmp(FieldOperand(eax, HeapNumber::kExponentOffset), Immediate(0x1)); | 3497 __ cmp(FieldOperand(eax, HeapNumber::kExponentOffset), Immediate(0x1)); |
3498 __ j(no_overflow, if_false); | 3498 __ j(no_overflow, if_false); |
3499 __ cmp(FieldOperand(eax, HeapNumber::kMantissaOffset), Immediate(0x0)); | 3499 __ cmp(FieldOperand(eax, HeapNumber::kMantissaOffset), Immediate(0x0)); |
3500 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3500 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3501 Split(equal, if_true, if_false, fall_through); | 3501 Split(equal, if_true, if_false, fall_through); |
3502 | 3502 |
3503 context()->Plug(if_true, if_false); | 3503 context()->Plug(if_true, if_false); |
3504 } | 3504 } |
3505 | 3505 |
3506 | 3506 |
3507 | |
3508 void FullCodeGenerator::EmitIsArray(CallRuntime* expr) { | 3507 void FullCodeGenerator::EmitIsArray(CallRuntime* expr) { |
3509 ZoneList<Expression*>* args = expr->arguments(); | 3508 ZoneList<Expression*>* args = expr->arguments(); |
3510 DCHECK(args->length() == 1); | 3509 DCHECK(args->length() == 1); |
3511 | 3510 |
3512 VisitForAccumulatorValue(args->at(0)); | 3511 VisitForAccumulatorValue(args->at(0)); |
3513 | 3512 |
3514 Label materialize_true, materialize_false; | 3513 Label materialize_true, materialize_false; |
3515 Label* if_true = NULL; | 3514 Label* if_true = NULL; |
3516 Label* if_false = NULL; | 3515 Label* if_false = NULL; |
3517 Label* fall_through = NULL; | 3516 Label* fall_through = NULL; |
3518 context()->PrepareTest(&materialize_true, &materialize_false, | 3517 context()->PrepareTest(&materialize_true, &materialize_false, |
3519 &if_true, &if_false, &fall_through); | 3518 &if_true, &if_false, &fall_through); |
3520 | 3519 |
3521 __ JumpIfSmi(eax, if_false); | 3520 __ JumpIfSmi(eax, if_false); |
3522 __ CmpObjectType(eax, JS_ARRAY_TYPE, ebx); | 3521 __ CmpObjectType(eax, JS_ARRAY_TYPE, ebx); |
3523 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3522 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3524 Split(equal, if_true, if_false, fall_through); | 3523 Split(equal, if_true, if_false, fall_through); |
3525 | 3524 |
3526 context()->Plug(if_true, if_false); | 3525 context()->Plug(if_true, if_false); |
3527 } | 3526 } |
3528 | 3527 |
3529 | 3528 |
| 3529 void FullCodeGenerator::EmitIsTypedArray(CallRuntime* expr) { |
| 3530 ZoneList<Expression*>* args = expr->arguments(); |
| 3531 DCHECK(args->length() == 1); |
| 3532 |
| 3533 VisitForAccumulatorValue(args->at(0)); |
| 3534 |
| 3535 Label materialize_true, materialize_false; |
| 3536 Label* if_true = NULL; |
| 3537 Label* if_false = NULL; |
| 3538 Label* fall_through = NULL; |
| 3539 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3540 &if_false, &fall_through); |
| 3541 |
| 3542 __ JumpIfSmi(eax, if_false); |
| 3543 __ CmpObjectType(eax, JS_TYPED_ARRAY_TYPE, ebx); |
| 3544 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3545 Split(equal, if_true, if_false, fall_through); |
| 3546 |
| 3547 context()->Plug(if_true, if_false); |
| 3548 } |
| 3549 |
| 3550 |
3530 void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) { | 3551 void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) { |
3531 ZoneList<Expression*>* args = expr->arguments(); | 3552 ZoneList<Expression*>* args = expr->arguments(); |
3532 DCHECK(args->length() == 1); | 3553 DCHECK(args->length() == 1); |
3533 | 3554 |
3534 VisitForAccumulatorValue(args->at(0)); | 3555 VisitForAccumulatorValue(args->at(0)); |
3535 | 3556 |
3536 Label materialize_true, materialize_false; | 3557 Label materialize_true, materialize_false; |
3537 Label* if_true = NULL; | 3558 Label* if_true = NULL; |
3538 Label* if_false = NULL; | 3559 Label* if_false = NULL; |
3539 Label* fall_through = NULL; | 3560 Label* fall_through = NULL; |
(...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5451 Assembler::target_address_at(call_target_address, | 5472 Assembler::target_address_at(call_target_address, |
5452 unoptimized_code)); | 5473 unoptimized_code)); |
5453 return OSR_AFTER_STACK_CHECK; | 5474 return OSR_AFTER_STACK_CHECK; |
5454 } | 5475 } |
5455 | 5476 |
5456 | 5477 |
5457 } // namespace internal | 5478 } // namespace internal |
5458 } // namespace v8 | 5479 } // namespace v8 |
5459 | 5480 |
5460 #endif // V8_TARGET_ARCH_X87 | 5481 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |