OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 4131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4142 } else if (String::Equals(check, factory->symbol_string())) { | 4142 } else if (String::Equals(check, factory->symbol_string())) { |
4143 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof symbol_string"); | 4143 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof symbol_string"); |
4144 __ JumpIfSmi(x0, if_false); | 4144 __ JumpIfSmi(x0, if_false); |
4145 __ CompareObjectType(x0, x0, x1, SYMBOL_TYPE); | 4145 __ CompareObjectType(x0, x0, x1, SYMBOL_TYPE); |
4146 Split(eq, if_true, if_false, fall_through); | 4146 Split(eq, if_true, if_false, fall_through); |
4147 } else if (String::Equals(check, factory->boolean_string())) { | 4147 } else if (String::Equals(check, factory->boolean_string())) { |
4148 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof boolean_string"); | 4148 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof boolean_string"); |
4149 __ JumpIfRoot(x0, Heap::kTrueValueRootIndex, if_true); | 4149 __ JumpIfRoot(x0, Heap::kTrueValueRootIndex, if_true); |
4150 __ CompareRoot(x0, Heap::kFalseValueRootIndex); | 4150 __ CompareRoot(x0, Heap::kFalseValueRootIndex); |
4151 Split(eq, if_true, if_false, fall_through); | 4151 Split(eq, if_true, if_false, fall_through); |
4152 } else if (FLAG_harmony_typeof && | |
4153 String::Equals(check, factory->null_string())) { | |
4154 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof null_string"); | |
4155 __ CompareRoot(x0, Heap::kNullValueRootIndex); | |
4156 Split(eq, if_true, if_false, fall_through); | |
4157 } else if (String::Equals(check, factory->undefined_string())) { | 4152 } else if (String::Equals(check, factory->undefined_string())) { |
4158 ASM_LOCATION( | 4153 ASM_LOCATION( |
4159 "FullCodeGenerator::EmitLiteralCompareTypeof undefined_string"); | 4154 "FullCodeGenerator::EmitLiteralCompareTypeof undefined_string"); |
4160 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true); | 4155 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true); |
4161 __ JumpIfSmi(x0, if_false); | 4156 __ JumpIfSmi(x0, if_false); |
4162 // Check for undetectable objects => true. | 4157 // Check for undetectable objects => true. |
4163 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); | 4158 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); |
4164 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset)); | 4159 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset)); |
4165 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_false, if_true, | 4160 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_false, if_true, |
4166 fall_through); | 4161 fall_through); |
4167 } else if (String::Equals(check, factory->function_string())) { | 4162 } else if (String::Equals(check, factory->function_string())) { |
4168 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof function_string"); | 4163 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof function_string"); |
4169 __ JumpIfSmi(x0, if_false); | 4164 __ JumpIfSmi(x0, if_false); |
4170 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 4165 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
4171 __ JumpIfObjectType(x0, x10, x11, JS_FUNCTION_TYPE, if_true); | 4166 __ JumpIfObjectType(x0, x10, x11, JS_FUNCTION_TYPE, if_true); |
4172 __ CompareAndSplit(x11, JS_FUNCTION_PROXY_TYPE, eq, if_true, if_false, | 4167 __ CompareAndSplit(x11, JS_FUNCTION_PROXY_TYPE, eq, if_true, if_false, |
4173 fall_through); | 4168 fall_through); |
4174 | 4169 |
4175 } else if (String::Equals(check, factory->object_string())) { | 4170 } else if (String::Equals(check, factory->object_string())) { |
4176 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof object_string"); | 4171 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof object_string"); |
4177 __ JumpIfSmi(x0, if_false); | 4172 __ JumpIfSmi(x0, if_false); |
4178 if (!FLAG_harmony_typeof) { | 4173 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, if_true); |
4179 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, if_true); | |
4180 } | |
4181 // Check for JS objects => true. | 4174 // Check for JS objects => true. |
4182 Register map = x10; | 4175 Register map = x10; |
4183 __ JumpIfObjectType(x0, map, x11, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, | 4176 __ JumpIfObjectType(x0, map, x11, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, |
4184 if_false, lt); | 4177 if_false, lt); |
4185 __ CompareInstanceType(map, x11, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4178 __ CompareInstanceType(map, x11, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
4186 __ B(gt, if_false); | 4179 __ B(gt, if_false); |
4187 // Check for undetectable objects => false. | 4180 // Check for undetectable objects => false. |
4188 __ Ldrb(x10, FieldMemOperand(map, Map::kBitFieldOffset)); | 4181 __ Ldrb(x10, FieldMemOperand(map, Map::kBitFieldOffset)); |
4189 | 4182 |
4190 __ TestAndSplit(x10, 1 << Map::kIsUndetectable, if_true, if_false, | 4183 __ TestAndSplit(x10, 1 << Map::kIsUndetectable, if_true, if_false, |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4886 return previous_; | 4879 return previous_; |
4887 } | 4880 } |
4888 | 4881 |
4889 | 4882 |
4890 #undef __ | 4883 #undef __ |
4891 | 4884 |
4892 | 4885 |
4893 } } // namespace v8::internal | 4886 } } // namespace v8::internal |
4894 | 4887 |
4895 #endif // V8_TARGET_ARCH_ARM64 | 4888 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |