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-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 4418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4429 Split(zero, if_true, if_false, fall_through); | 4429 Split(zero, if_true, if_false, fall_through); |
4430 } else if (String::Equals(check, factory->symbol_string())) { | 4430 } else if (String::Equals(check, factory->symbol_string())) { |
4431 __ JumpIfSmi(eax, if_false); | 4431 __ JumpIfSmi(eax, if_false); |
4432 __ CmpObjectType(eax, SYMBOL_TYPE, edx); | 4432 __ CmpObjectType(eax, SYMBOL_TYPE, edx); |
4433 Split(equal, if_true, if_false, fall_through); | 4433 Split(equal, if_true, if_false, fall_through); |
4434 } else if (String::Equals(check, factory->boolean_string())) { | 4434 } else if (String::Equals(check, factory->boolean_string())) { |
4435 __ cmp(eax, isolate()->factory()->true_value()); | 4435 __ cmp(eax, isolate()->factory()->true_value()); |
4436 __ j(equal, if_true); | 4436 __ j(equal, if_true); |
4437 __ cmp(eax, isolate()->factory()->false_value()); | 4437 __ cmp(eax, isolate()->factory()->false_value()); |
4438 Split(equal, if_true, if_false, fall_through); | 4438 Split(equal, if_true, if_false, fall_through); |
4439 } else if (FLAG_harmony_typeof && | |
4440 String::Equals(check, factory->null_string())) { | |
4441 __ cmp(eax, isolate()->factory()->null_value()); | |
4442 Split(equal, if_true, if_false, fall_through); | |
4443 } else if (String::Equals(check, factory->undefined_string())) { | 4439 } else if (String::Equals(check, factory->undefined_string())) { |
4444 __ cmp(eax, isolate()->factory()->undefined_value()); | 4440 __ cmp(eax, isolate()->factory()->undefined_value()); |
4445 __ j(equal, if_true); | 4441 __ j(equal, if_true); |
4446 __ JumpIfSmi(eax, if_false); | 4442 __ JumpIfSmi(eax, if_false); |
4447 // Check for undetectable objects => true. | 4443 // Check for undetectable objects => true. |
4448 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); | 4444 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); |
4449 __ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset)); | 4445 __ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset)); |
4450 __ test(ecx, Immediate(1 << Map::kIsUndetectable)); | 4446 __ test(ecx, Immediate(1 << Map::kIsUndetectable)); |
4451 Split(not_zero, if_true, if_false, fall_through); | 4447 Split(not_zero, if_true, if_false, fall_through); |
4452 } else if (String::Equals(check, factory->function_string())) { | 4448 } else if (String::Equals(check, factory->function_string())) { |
4453 __ JumpIfSmi(eax, if_false); | 4449 __ JumpIfSmi(eax, if_false); |
4454 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 4450 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
4455 __ CmpObjectType(eax, JS_FUNCTION_TYPE, edx); | 4451 __ CmpObjectType(eax, JS_FUNCTION_TYPE, edx); |
4456 __ j(equal, if_true); | 4452 __ j(equal, if_true); |
4457 __ CmpInstanceType(edx, JS_FUNCTION_PROXY_TYPE); | 4453 __ CmpInstanceType(edx, JS_FUNCTION_PROXY_TYPE); |
4458 Split(equal, if_true, if_false, fall_through); | 4454 Split(equal, if_true, if_false, fall_through); |
4459 } else if (String::Equals(check, factory->object_string())) { | 4455 } else if (String::Equals(check, factory->object_string())) { |
4460 __ JumpIfSmi(eax, if_false); | 4456 __ JumpIfSmi(eax, if_false); |
4461 if (!FLAG_harmony_typeof) { | 4457 __ cmp(eax, isolate()->factory()->null_value()); |
4462 __ cmp(eax, isolate()->factory()->null_value()); | 4458 __ j(equal, if_true); |
4463 __ j(equal, if_true); | |
4464 } | |
4465 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); | 4459 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); |
4466 __ j(below, if_false); | 4460 __ j(below, if_false); |
4467 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4461 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
4468 __ j(above, if_false); | 4462 __ j(above, if_false); |
4469 // Check for undetectable objects => false. | 4463 // Check for undetectable objects => false. |
4470 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), | 4464 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
4471 1 << Map::kIsUndetectable); | 4465 1 << Map::kIsUndetectable); |
4472 Split(zero, if_true, if_false, fall_through); | 4466 Split(zero, if_true, if_false, fall_through); |
4473 } else { | 4467 } else { |
4474 if (if_false != fall_through) __ jmp(if_false); | 4468 if (if_false != fall_through) __ jmp(if_false); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4796 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4790 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4797 Assembler::target_address_at(call_target_address, | 4791 Assembler::target_address_at(call_target_address, |
4798 unoptimized_code)); | 4792 unoptimized_code)); |
4799 return OSR_AFTER_STACK_CHECK; | 4793 return OSR_AFTER_STACK_CHECK; |
4800 } | 4794 } |
4801 | 4795 |
4802 | 4796 |
4803 } } // namespace v8::internal | 4797 } } // namespace v8::internal |
4804 | 4798 |
4805 #endif // V8_TARGET_ARCH_IA32 | 4799 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |