OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 4220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4231 Label* if_false = NULL; | 4231 Label* if_false = NULL; |
4232 Label* fall_through = NULL; | 4232 Label* fall_through = NULL; |
4233 context()->PrepareTest(&materialize_true, &materialize_false, | 4233 context()->PrepareTest(&materialize_true, &materialize_false, |
4234 &if_true, &if_false, &fall_through); | 4234 &if_true, &if_false, &fall_through); |
4235 | 4235 |
4236 { AccumulatorValueContext context(this); | 4236 { AccumulatorValueContext context(this); |
4237 VisitForTypeofValue(sub_expr); | 4237 VisitForTypeofValue(sub_expr); |
4238 } | 4238 } |
4239 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4239 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
4240 | 4240 |
4241 if (check->Equals(isolate()->heap()->number_string())) { | 4241 Factory* factory = isolate()->factory(); |
| 4242 if (String::Equals(check, factory->number_string())) { |
4242 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof number_string"); | 4243 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof number_string"); |
4243 __ JumpIfSmi(x0, if_true); | 4244 __ JumpIfSmi(x0, if_true); |
4244 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); | 4245 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); |
4245 __ CompareRoot(x0, Heap::kHeapNumberMapRootIndex); | 4246 __ CompareRoot(x0, Heap::kHeapNumberMapRootIndex); |
4246 Split(eq, if_true, if_false, fall_through); | 4247 Split(eq, if_true, if_false, fall_through); |
4247 } else if (check->Equals(isolate()->heap()->string_string())) { | 4248 } else if (String::Equals(check, factory->string_string())) { |
4248 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof string_string"); | 4249 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof string_string"); |
4249 __ JumpIfSmi(x0, if_false); | 4250 __ JumpIfSmi(x0, if_false); |
4250 // Check for undetectable objects => false. | 4251 // Check for undetectable objects => false. |
4251 __ JumpIfObjectType(x0, x0, x1, FIRST_NONSTRING_TYPE, if_false, ge); | 4252 __ JumpIfObjectType(x0, x0, x1, FIRST_NONSTRING_TYPE, if_false, ge); |
4252 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset)); | 4253 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset)); |
4253 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_true, if_false, | 4254 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_true, if_false, |
4254 fall_through); | 4255 fall_through); |
4255 } else if (check->Equals(isolate()->heap()->symbol_string())) { | 4256 } else if (String::Equals(check, factory->symbol_string())) { |
4256 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof symbol_string"); | 4257 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof symbol_string"); |
4257 __ JumpIfSmi(x0, if_false); | 4258 __ JumpIfSmi(x0, if_false); |
4258 __ CompareObjectType(x0, x0, x1, SYMBOL_TYPE); | 4259 __ CompareObjectType(x0, x0, x1, SYMBOL_TYPE); |
4259 Split(eq, if_true, if_false, fall_through); | 4260 Split(eq, if_true, if_false, fall_through); |
4260 } else if (check->Equals(isolate()->heap()->boolean_string())) { | 4261 } else if (String::Equals(check, factory->boolean_string())) { |
4261 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof boolean_string"); | 4262 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof boolean_string"); |
4262 __ JumpIfRoot(x0, Heap::kTrueValueRootIndex, if_true); | 4263 __ JumpIfRoot(x0, Heap::kTrueValueRootIndex, if_true); |
4263 __ CompareRoot(x0, Heap::kFalseValueRootIndex); | 4264 __ CompareRoot(x0, Heap::kFalseValueRootIndex); |
4264 Split(eq, if_true, if_false, fall_through); | 4265 Split(eq, if_true, if_false, fall_through); |
4265 } else if (FLAG_harmony_typeof && | 4266 } else if (FLAG_harmony_typeof && |
4266 check->Equals(isolate()->heap()->null_string())) { | 4267 String::Equals(check, factory->null_string())) { |
4267 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof null_string"); | 4268 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof null_string"); |
4268 __ CompareRoot(x0, Heap::kNullValueRootIndex); | 4269 __ CompareRoot(x0, Heap::kNullValueRootIndex); |
4269 Split(eq, if_true, if_false, fall_through); | 4270 Split(eq, if_true, if_false, fall_through); |
4270 } else if (check->Equals(isolate()->heap()->undefined_string())) { | 4271 } else if (String::Equals(check, factory->undefined_string())) { |
4271 ASM_LOCATION( | 4272 ASM_LOCATION( |
4272 "FullCodeGenerator::EmitLiteralCompareTypeof undefined_string"); | 4273 "FullCodeGenerator::EmitLiteralCompareTypeof undefined_string"); |
4273 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true); | 4274 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true); |
4274 __ JumpIfSmi(x0, if_false); | 4275 __ JumpIfSmi(x0, if_false); |
4275 // Check for undetectable objects => true. | 4276 // Check for undetectable objects => true. |
4276 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); | 4277 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); |
4277 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset)); | 4278 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset)); |
4278 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_false, if_true, | 4279 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_false, if_true, |
4279 fall_through); | 4280 fall_through); |
4280 } else if (check->Equals(isolate()->heap()->function_string())) { | 4281 } else if (String::Equals(check, factory->function_string())) { |
4281 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof function_string"); | 4282 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof function_string"); |
4282 __ JumpIfSmi(x0, if_false); | 4283 __ JumpIfSmi(x0, if_false); |
4283 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 4284 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
4284 __ JumpIfObjectType(x0, x10, x11, JS_FUNCTION_TYPE, if_true); | 4285 __ JumpIfObjectType(x0, x10, x11, JS_FUNCTION_TYPE, if_true); |
4285 __ CompareAndSplit(x11, JS_FUNCTION_PROXY_TYPE, eq, if_true, if_false, | 4286 __ CompareAndSplit(x11, JS_FUNCTION_PROXY_TYPE, eq, if_true, if_false, |
4286 fall_through); | 4287 fall_through); |
4287 | 4288 |
4288 } else if (check->Equals(isolate()->heap()->object_string())) { | 4289 } else if (String::Equals(check, factory->object_string())) { |
4289 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof object_string"); | 4290 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof object_string"); |
4290 __ JumpIfSmi(x0, if_false); | 4291 __ JumpIfSmi(x0, if_false); |
4291 if (!FLAG_harmony_typeof) { | 4292 if (!FLAG_harmony_typeof) { |
4292 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, if_true); | 4293 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, if_true); |
4293 } | 4294 } |
4294 // Check for JS objects => true. | 4295 // Check for JS objects => true. |
4295 Register map = x10; | 4296 Register map = x10; |
4296 __ JumpIfObjectType(x0, map, x11, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, | 4297 __ JumpIfObjectType(x0, map, x11, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, |
4297 if_false, lt); | 4298 if_false, lt); |
4298 __ CompareInstanceType(map, x11, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4299 __ CompareInstanceType(map, x11, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4991 return previous_; | 4992 return previous_; |
4992 } | 4993 } |
4993 | 4994 |
4994 | 4995 |
4995 #undef __ | 4996 #undef __ |
4996 | 4997 |
4997 | 4998 |
4998 } } // namespace v8::internal | 4999 } } // namespace v8::internal |
4999 | 5000 |
5000 #endif // V8_TARGET_ARCH_ARM64 | 5001 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |