OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4098 __ j(above_equal, if_false); | 4098 __ j(above_equal, if_false); |
4099 // Check for undetectable objects => false. | 4099 // Check for undetectable objects => false. |
4100 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), | 4100 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
4101 1 << Map::kIsUndetectable); | 4101 1 << Map::kIsUndetectable); |
4102 Split(zero, if_true, if_false, fall_through); | 4102 Split(zero, if_true, if_false, fall_through); |
4103 } else if (check->Equals(isolate()->heap()->boolean_symbol())) { | 4103 } else if (check->Equals(isolate()->heap()->boolean_symbol())) { |
4104 __ cmp(eax, isolate()->factory()->true_value()); | 4104 __ cmp(eax, isolate()->factory()->true_value()); |
4105 __ j(equal, if_true); | 4105 __ j(equal, if_true); |
4106 __ cmp(eax, isolate()->factory()->false_value()); | 4106 __ cmp(eax, isolate()->factory()->false_value()); |
4107 Split(equal, if_true, if_false, fall_through); | 4107 Split(equal, if_true, if_false, fall_through); |
| 4108 } else if (FLAG_harmony_typeof && |
| 4109 check->Equals(isolate()->heap()->null_symbol())) { |
| 4110 __ cmp(eax, isolate()->factory()->null_value()); |
| 4111 Split(equal, if_true, if_false, fall_through); |
4108 } else if (check->Equals(isolate()->heap()->undefined_symbol())) { | 4112 } else if (check->Equals(isolate()->heap()->undefined_symbol())) { |
4109 __ cmp(eax, isolate()->factory()->undefined_value()); | 4113 __ cmp(eax, isolate()->factory()->undefined_value()); |
4110 __ j(equal, if_true); | 4114 __ j(equal, if_true); |
4111 __ JumpIfSmi(eax, if_false); | 4115 __ JumpIfSmi(eax, if_false); |
4112 // Check for undetectable objects => true. | 4116 // Check for undetectable objects => true. |
4113 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); | 4117 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); |
4114 __ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset)); | 4118 __ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset)); |
4115 __ test(ecx, Immediate(1 << Map::kIsUndetectable)); | 4119 __ test(ecx, Immediate(1 << Map::kIsUndetectable)); |
4116 Split(not_zero, if_true, if_false, fall_through); | 4120 Split(not_zero, if_true, if_false, fall_through); |
4117 } else if (check->Equals(isolate()->heap()->function_symbol())) { | 4121 } else if (check->Equals(isolate()->heap()->function_symbol())) { |
4118 __ JumpIfSmi(eax, if_false); | 4122 __ JumpIfSmi(eax, if_false); |
4119 __ CmpObjectType(eax, FIRST_CALLABLE_SPEC_OBJECT_TYPE, edx); | 4123 __ CmpObjectType(eax, FIRST_CALLABLE_SPEC_OBJECT_TYPE, edx); |
4120 Split(above_equal, if_true, if_false, fall_through); | 4124 Split(above_equal, if_true, if_false, fall_through); |
4121 } else if (check->Equals(isolate()->heap()->object_symbol())) { | 4125 } else if (check->Equals(isolate()->heap()->object_symbol())) { |
4122 __ JumpIfSmi(eax, if_false); | 4126 __ JumpIfSmi(eax, if_false); |
4123 __ cmp(eax, isolate()->factory()->null_value()); | 4127 if (!FLAG_harmony_typeof) { |
4124 __ j(equal, if_true); | 4128 __ cmp(eax, isolate()->factory()->null_value()); |
| 4129 __ j(equal, if_true); |
| 4130 } |
4125 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); | 4131 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); |
4126 __ j(below, if_false); | 4132 __ j(below, if_false); |
4127 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4133 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
4128 __ j(above, if_false); | 4134 __ j(above, if_false); |
4129 // Check for undetectable objects => false. | 4135 // Check for undetectable objects => false. |
4130 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), | 4136 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
4131 1 << Map::kIsUndetectable); | 4137 1 << Map::kIsUndetectable); |
4132 Split(zero, if_true, if_false, fall_through); | 4138 Split(zero, if_true, if_false, fall_through); |
4133 } else { | 4139 } else { |
4134 if (if_false != fall_through) __ jmp(if_false); | 4140 if (if_false != fall_through) __ jmp(if_false); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4364 __ add(Operand(edx), Immediate(masm_->CodeObject())); | 4370 __ add(Operand(edx), Immediate(masm_->CodeObject())); |
4365 __ jmp(Operand(edx)); | 4371 __ jmp(Operand(edx)); |
4366 } | 4372 } |
4367 | 4373 |
4368 | 4374 |
4369 #undef __ | 4375 #undef __ |
4370 | 4376 |
4371 } } // namespace v8::internal | 4377 } } // namespace v8::internal |
4372 | 4378 |
4373 #endif // V8_TARGET_ARCH_IA32 | 4379 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |