| 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 3953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3964 __ CmpObjectType(rax, FIRST_NONSTRING_TYPE, rdx); | 3964 __ CmpObjectType(rax, FIRST_NONSTRING_TYPE, rdx); |
| 3965 __ j(above_equal, if_false); | 3965 __ j(above_equal, if_false); |
| 3966 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), | 3966 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), |
| 3967 Immediate(1 << Map::kIsUndetectable)); | 3967 Immediate(1 << Map::kIsUndetectable)); |
| 3968 Split(zero, if_true, if_false, fall_through); | 3968 Split(zero, if_true, if_false, fall_through); |
| 3969 } else if (check->Equals(isolate()->heap()->boolean_symbol())) { | 3969 } else if (check->Equals(isolate()->heap()->boolean_symbol())) { |
| 3970 __ CompareRoot(rax, Heap::kTrueValueRootIndex); | 3970 __ CompareRoot(rax, Heap::kTrueValueRootIndex); |
| 3971 __ j(equal, if_true); | 3971 __ j(equal, if_true); |
| 3972 __ CompareRoot(rax, Heap::kFalseValueRootIndex); | 3972 __ CompareRoot(rax, Heap::kFalseValueRootIndex); |
| 3973 Split(equal, if_true, if_false, fall_through); | 3973 Split(equal, if_true, if_false, fall_through); |
| 3974 } else if (FLAG_harmony_typeof && |
| 3975 check->Equals(isolate()->heap()->null_symbol())) { |
| 3976 __ CompareRoot(rax, Heap::kNullValueRootIndex); |
| 3977 Split(equal, if_true, if_false, fall_through); |
| 3974 } else if (check->Equals(isolate()->heap()->undefined_symbol())) { | 3978 } else if (check->Equals(isolate()->heap()->undefined_symbol())) { |
| 3975 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex); | 3979 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex); |
| 3976 __ j(equal, if_true); | 3980 __ j(equal, if_true); |
| 3977 __ JumpIfSmi(rax, if_false); | 3981 __ JumpIfSmi(rax, if_false); |
| 3978 // Check for undetectable objects => true. | 3982 // Check for undetectable objects => true. |
| 3979 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset)); | 3983 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset)); |
| 3980 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), | 3984 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), |
| 3981 Immediate(1 << Map::kIsUndetectable)); | 3985 Immediate(1 << Map::kIsUndetectable)); |
| 3982 Split(not_zero, if_true, if_false, fall_through); | 3986 Split(not_zero, if_true, if_false, fall_through); |
| 3983 } else if (check->Equals(isolate()->heap()->function_symbol())) { | 3987 } else if (check->Equals(isolate()->heap()->function_symbol())) { |
| 3984 __ JumpIfSmi(rax, if_false); | 3988 __ JumpIfSmi(rax, if_false); |
| 3985 STATIC_ASSERT(LAST_CALLABLE_SPEC_OBJECT_TYPE == LAST_TYPE); | 3989 STATIC_ASSERT(LAST_CALLABLE_SPEC_OBJECT_TYPE == LAST_TYPE); |
| 3986 __ CmpObjectType(rax, FIRST_CALLABLE_SPEC_OBJECT_TYPE, rdx); | 3990 __ CmpObjectType(rax, FIRST_CALLABLE_SPEC_OBJECT_TYPE, rdx); |
| 3987 Split(above_equal, if_true, if_false, fall_through); | 3991 Split(above_equal, if_true, if_false, fall_through); |
| 3988 } else if (check->Equals(isolate()->heap()->object_symbol())) { | 3992 } else if (check->Equals(isolate()->heap()->object_symbol())) { |
| 3989 __ JumpIfSmi(rax, if_false); | 3993 __ JumpIfSmi(rax, if_false); |
| 3990 __ CompareRoot(rax, Heap::kNullValueRootIndex); | 3994 if (!FLAG_harmony_typeof) { |
| 3991 __ j(equal, if_true); | 3995 __ CompareRoot(rax, Heap::kNullValueRootIndex); |
| 3996 __ j(equal, if_true); |
| 3997 } |
| 3992 __ CmpObjectType(rax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, rdx); | 3998 __ CmpObjectType(rax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, rdx); |
| 3993 __ j(below, if_false); | 3999 __ j(below, if_false); |
| 3994 __ CmpInstanceType(rdx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4000 __ CmpInstanceType(rdx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 3995 __ j(above, if_false); | 4001 __ j(above, if_false); |
| 3996 // Check for undetectable objects => false. | 4002 // Check for undetectable objects => false. |
| 3997 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), | 4003 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), |
| 3998 Immediate(1 << Map::kIsUndetectable)); | 4004 Immediate(1 << Map::kIsUndetectable)); |
| 3999 Split(zero, if_true, if_false, fall_through); | 4005 Split(zero, if_true, if_false, fall_through); |
| 4000 } else { | 4006 } else { |
| 4001 if (if_false != fall_through) __ jmp(if_false); | 4007 if (if_false != fall_through) __ jmp(if_false); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4229 __ jmp(rdx); | 4235 __ jmp(rdx); |
| 4230 } | 4236 } |
| 4231 | 4237 |
| 4232 | 4238 |
| 4233 #undef __ | 4239 #undef __ |
| 4234 | 4240 |
| 4235 | 4241 |
| 4236 } } // namespace v8::internal | 4242 } } // namespace v8::internal |
| 4237 | 4243 |
| 4238 #endif // V8_TARGET_ARCH_X64 | 4244 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |