OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4529 Label* if_false = NULL; | 4529 Label* if_false = NULL; |
4530 Label* fall_through = NULL; | 4530 Label* fall_through = NULL; |
4531 context()->PrepareTest(&materialize_true, &materialize_false, | 4531 context()->PrepareTest(&materialize_true, &materialize_false, |
4532 &if_true, &if_false, &fall_through); | 4532 &if_true, &if_false, &fall_through); |
4533 | 4533 |
4534 { AccumulatorValueContext context(this); | 4534 { AccumulatorValueContext context(this); |
4535 VisitForTypeofValue(sub_expr); | 4535 VisitForTypeofValue(sub_expr); |
4536 } | 4536 } |
4537 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4537 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
4538 | 4538 |
4539 if (check->Equals(isolate()->heap()->number_string())) { | 4539 Factory* factory = isolate()->factory(); |
| 4540 if (String::Equals(check, factory->number_string())) { |
4540 __ JumpIfSmi(eax, if_true); | 4541 __ JumpIfSmi(eax, if_true); |
4541 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), | 4542 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), |
4542 isolate()->factory()->heap_number_map()); | 4543 isolate()->factory()->heap_number_map()); |
4543 Split(equal, if_true, if_false, fall_through); | 4544 Split(equal, if_true, if_false, fall_through); |
4544 } else if (check->Equals(isolate()->heap()->string_string())) { | 4545 } else if (String::Equals(check, factory->string_string())) { |
4545 __ JumpIfSmi(eax, if_false); | 4546 __ JumpIfSmi(eax, if_false); |
4546 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edx); | 4547 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edx); |
4547 __ j(above_equal, if_false); | 4548 __ j(above_equal, if_false); |
4548 // Check for undetectable objects => false. | 4549 // Check for undetectable objects => false. |
4549 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), | 4550 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
4550 1 << Map::kIsUndetectable); | 4551 1 << Map::kIsUndetectable); |
4551 Split(zero, if_true, if_false, fall_through); | 4552 Split(zero, if_true, if_false, fall_through); |
4552 } else if (check->Equals(isolate()->heap()->symbol_string())) { | 4553 } else if (String::Equals(check, factory->symbol_string())) { |
4553 __ JumpIfSmi(eax, if_false); | 4554 __ JumpIfSmi(eax, if_false); |
4554 __ CmpObjectType(eax, SYMBOL_TYPE, edx); | 4555 __ CmpObjectType(eax, SYMBOL_TYPE, edx); |
4555 Split(equal, if_true, if_false, fall_through); | 4556 Split(equal, if_true, if_false, fall_through); |
4556 } else if (check->Equals(isolate()->heap()->boolean_string())) { | 4557 } else if (String::Equals(check, factory->boolean_string())) { |
4557 __ cmp(eax, isolate()->factory()->true_value()); | 4558 __ cmp(eax, isolate()->factory()->true_value()); |
4558 __ j(equal, if_true); | 4559 __ j(equal, if_true); |
4559 __ cmp(eax, isolate()->factory()->false_value()); | 4560 __ cmp(eax, isolate()->factory()->false_value()); |
4560 Split(equal, if_true, if_false, fall_through); | 4561 Split(equal, if_true, if_false, fall_through); |
4561 } else if (FLAG_harmony_typeof && | 4562 } else if (FLAG_harmony_typeof && |
4562 check->Equals(isolate()->heap()->null_string())) { | 4563 String::Equals(check, factory->null_string())) { |
4563 __ cmp(eax, isolate()->factory()->null_value()); | 4564 __ cmp(eax, isolate()->factory()->null_value()); |
4564 Split(equal, if_true, if_false, fall_through); | 4565 Split(equal, if_true, if_false, fall_through); |
4565 } else if (check->Equals(isolate()->heap()->undefined_string())) { | 4566 } else if (String::Equals(check, factory->undefined_string())) { |
4566 __ cmp(eax, isolate()->factory()->undefined_value()); | 4567 __ cmp(eax, isolate()->factory()->undefined_value()); |
4567 __ j(equal, if_true); | 4568 __ j(equal, if_true); |
4568 __ JumpIfSmi(eax, if_false); | 4569 __ JumpIfSmi(eax, if_false); |
4569 // Check for undetectable objects => true. | 4570 // Check for undetectable objects => true. |
4570 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); | 4571 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); |
4571 __ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset)); | 4572 __ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset)); |
4572 __ test(ecx, Immediate(1 << Map::kIsUndetectable)); | 4573 __ test(ecx, Immediate(1 << Map::kIsUndetectable)); |
4573 Split(not_zero, if_true, if_false, fall_through); | 4574 Split(not_zero, if_true, if_false, fall_through); |
4574 } else if (check->Equals(isolate()->heap()->function_string())) { | 4575 } else if (String::Equals(check, factory->function_string())) { |
4575 __ JumpIfSmi(eax, if_false); | 4576 __ JumpIfSmi(eax, if_false); |
4576 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 4577 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
4577 __ CmpObjectType(eax, JS_FUNCTION_TYPE, edx); | 4578 __ CmpObjectType(eax, JS_FUNCTION_TYPE, edx); |
4578 __ j(equal, if_true); | 4579 __ j(equal, if_true); |
4579 __ CmpInstanceType(edx, JS_FUNCTION_PROXY_TYPE); | 4580 __ CmpInstanceType(edx, JS_FUNCTION_PROXY_TYPE); |
4580 Split(equal, if_true, if_false, fall_through); | 4581 Split(equal, if_true, if_false, fall_through); |
4581 } else if (check->Equals(isolate()->heap()->object_string())) { | 4582 } else if (String::Equals(check, factory->object_string())) { |
4582 __ JumpIfSmi(eax, if_false); | 4583 __ JumpIfSmi(eax, if_false); |
4583 if (!FLAG_harmony_typeof) { | 4584 if (!FLAG_harmony_typeof) { |
4584 __ cmp(eax, isolate()->factory()->null_value()); | 4585 __ cmp(eax, isolate()->factory()->null_value()); |
4585 __ j(equal, if_true); | 4586 __ j(equal, if_true); |
4586 } | 4587 } |
4587 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); | 4588 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); |
4588 __ j(below, if_false); | 4589 __ j(below, if_false); |
4589 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4590 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
4590 __ j(above, if_false); | 4591 __ j(above, if_false); |
4591 // Check for undetectable objects => false. | 4592 // Check for undetectable objects => false. |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4918 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4919 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4919 Assembler::target_address_at(call_target_address, | 4920 Assembler::target_address_at(call_target_address, |
4920 unoptimized_code)); | 4921 unoptimized_code)); |
4921 return OSR_AFTER_STACK_CHECK; | 4922 return OSR_AFTER_STACK_CHECK; |
4922 } | 4923 } |
4923 | 4924 |
4924 | 4925 |
4925 } } // namespace v8::internal | 4926 } } // namespace v8::internal |
4926 | 4927 |
4927 #endif // V8_TARGET_ARCH_IA32 | 4928 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |