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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3680 __ j(equal, if_true); | 3680 __ j(equal, if_true); |
3681 __ cmp(eax, isolate()->factory()->false_value()); | 3681 __ cmp(eax, isolate()->factory()->false_value()); |
3682 Split(equal, if_true, if_false, fall_through); | 3682 Split(equal, if_true, if_false, fall_through); |
3683 } else if (String::Equals(check, factory->undefined_string())) { | 3683 } else if (String::Equals(check, factory->undefined_string())) { |
3684 __ cmp(eax, isolate()->factory()->null_value()); | 3684 __ cmp(eax, isolate()->factory()->null_value()); |
3685 __ j(equal, if_false); | 3685 __ j(equal, if_false); |
3686 __ JumpIfSmi(eax, if_false); | 3686 __ JumpIfSmi(eax, if_false); |
3687 // Check for undetectable objects => true. | 3687 // Check for undetectable objects => true. |
3688 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); | 3688 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); |
3689 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), | 3689 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
3690 1 << Map::kIsUndetectable); | 3690 Immediate(1 << Map::kIsUndetectable)); |
3691 Split(not_zero, if_true, if_false, fall_through); | 3691 Split(not_zero, if_true, if_false, fall_through); |
3692 } else if (String::Equals(check, factory->function_string())) { | 3692 } else if (String::Equals(check, factory->function_string())) { |
3693 __ JumpIfSmi(eax, if_false); | 3693 __ JumpIfSmi(eax, if_false); |
3694 // Check for callable and not undetectable objects => true. | 3694 // Check for callable and not undetectable objects => true. |
3695 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); | 3695 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); |
3696 __ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset)); | 3696 __ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset)); |
3697 __ and_(ecx, (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)); | 3697 __ and_(ecx, (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)); |
3698 __ cmp(ecx, 1 << Map::kIsCallable); | 3698 __ cmp(ecx, 1 << Map::kIsCallable); |
3699 Split(equal, if_true, if_false, fall_through); | 3699 Split(equal, if_true, if_false, fall_through); |
3700 } else if (String::Equals(check, factory->object_string())) { | 3700 } else if (String::Equals(check, factory->object_string())) { |
3701 __ JumpIfSmi(eax, if_false); | 3701 __ JumpIfSmi(eax, if_false); |
3702 __ cmp(eax, isolate()->factory()->null_value()); | 3702 __ cmp(eax, isolate()->factory()->null_value()); |
3703 __ j(equal, if_true); | 3703 __ j(equal, if_true); |
3704 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 3704 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
3705 __ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, edx); | 3705 __ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, edx); |
3706 __ j(below, if_false); | 3706 __ j(below, if_false); |
3707 // Check for callable or undetectable objects => false. | 3707 // Check for callable or undetectable objects => false. |
3708 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), | 3708 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
3709 (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)); | 3709 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
3710 Split(zero, if_true, if_false, fall_through); | 3710 Split(zero, if_true, if_false, fall_through); |
3711 // clang-format off | 3711 // clang-format off |
3712 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 3712 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
3713 } else if (String::Equals(check, factory->type##_string())) { \ | 3713 } else if (String::Equals(check, factory->type##_string())) { \ |
3714 __ JumpIfSmi(eax, if_false); \ | 3714 __ JumpIfSmi(eax, if_false); \ |
3715 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), \ | 3715 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), \ |
3716 isolate()->factory()->type##_map()); \ | 3716 isolate()->factory()->type##_map()); \ |
3717 Split(equal, if_true, if_false, fall_through); | 3717 Split(equal, if_true, if_false, fall_through); |
3718 SIMD128_TYPES(SIMD128_TYPE) | 3718 SIMD128_TYPES(SIMD128_TYPE) |
3719 #undef SIMD128_TYPE | 3719 #undef SIMD128_TYPE |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3813 Handle<Object> nil_value = nil == kNullValue | 3813 Handle<Object> nil_value = nil == kNullValue |
3814 ? isolate()->factory()->null_value() | 3814 ? isolate()->factory()->null_value() |
3815 : isolate()->factory()->undefined_value(); | 3815 : isolate()->factory()->undefined_value(); |
3816 if (expr->op() == Token::EQ_STRICT) { | 3816 if (expr->op() == Token::EQ_STRICT) { |
3817 __ cmp(eax, nil_value); | 3817 __ cmp(eax, nil_value); |
3818 Split(equal, if_true, if_false, fall_through); | 3818 Split(equal, if_true, if_false, fall_through); |
3819 } else { | 3819 } else { |
3820 __ JumpIfSmi(eax, if_false); | 3820 __ JumpIfSmi(eax, if_false); |
3821 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); | 3821 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); |
3822 __ test_b(FieldOperand(eax, Map::kBitFieldOffset), | 3822 __ test_b(FieldOperand(eax, Map::kBitFieldOffset), |
3823 1 << Map::kIsUndetectable); | 3823 Immediate(1 << Map::kIsUndetectable)); |
3824 Split(not_zero, if_true, if_false, fall_through); | 3824 Split(not_zero, if_true, if_false, fall_through); |
3825 } | 3825 } |
3826 context()->Plug(if_true, if_false); | 3826 context()->Plug(if_true, if_false); |
3827 } | 3827 } |
3828 | 3828 |
3829 | 3829 |
3830 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 3830 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
3831 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 3831 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
3832 context()->Plug(eax); | 3832 context()->Plug(eax); |
3833 } | 3833 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4006 isolate->builtins()->OnStackReplacement()->entry(), | 4006 isolate->builtins()->OnStackReplacement()->entry(), |
4007 Assembler::target_address_at(call_target_address, unoptimized_code)); | 4007 Assembler::target_address_at(call_target_address, unoptimized_code)); |
4008 return ON_STACK_REPLACEMENT; | 4008 return ON_STACK_REPLACEMENT; |
4009 } | 4009 } |
4010 | 4010 |
4011 | 4011 |
4012 } // namespace internal | 4012 } // namespace internal |
4013 } // namespace v8 | 4013 } // namespace v8 |
4014 | 4014 |
4015 #endif // V8_TARGET_ARCH_IA32 | 4015 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |