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 #include "src/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
8 #include "src/arm64/lithium-gap-resolver-arm64.h" | 8 #include "src/arm64/lithium-gap-resolver-arm64.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 2340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2351 Handle<String> class_name = instr->hydrogen()->class_name(); | 2351 Handle<String> class_name = instr->hydrogen()->class_name(); |
2352 Label* true_label = instr->TrueLabel(chunk_); | 2352 Label* true_label = instr->TrueLabel(chunk_); |
2353 Label* false_label = instr->FalseLabel(chunk_); | 2353 Label* false_label = instr->FalseLabel(chunk_); |
2354 Register input = ToRegister(instr->value()); | 2354 Register input = ToRegister(instr->value()); |
2355 Register scratch1 = ToRegister(instr->temp1()); | 2355 Register scratch1 = ToRegister(instr->temp1()); |
2356 Register scratch2 = ToRegister(instr->temp2()); | 2356 Register scratch2 = ToRegister(instr->temp2()); |
2357 | 2357 |
2358 __ JumpIfSmi(input, false_label); | 2358 __ JumpIfSmi(input, false_label); |
2359 | 2359 |
2360 Register map = scratch2; | 2360 Register map = scratch2; |
2361 if (class_name->IsUtf8EqualTo(CStrVector("Function"))) { | 2361 if (String::Equals(isolate()->factory()->Function_string(), class_name)) { |
2362 // Assuming the following assertions, we can use the same compares to test | 2362 // Assuming the following assertions, we can use the same compares to test |
2363 // for both being a function type and being in the object type range. | 2363 // for both being a function type and being in the object type range. |
2364 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 2364 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
2365 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE == | 2365 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE == |
2366 FIRST_SPEC_OBJECT_TYPE + 1); | 2366 FIRST_SPEC_OBJECT_TYPE + 1); |
2367 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == | 2367 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == |
2368 LAST_SPEC_OBJECT_TYPE - 1); | 2368 LAST_SPEC_OBJECT_TYPE - 1); |
2369 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 2369 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
2370 | 2370 |
2371 // We expect CompareObjectType to load the object instance type in scratch1. | 2371 // We expect CompareObjectType to load the object instance type in scratch1. |
2372 __ CompareObjectType(input, map, scratch1, FIRST_SPEC_OBJECT_TYPE); | 2372 __ CompareObjectType(input, map, scratch1, FIRST_SPEC_OBJECT_TYPE); |
2373 __ B(lt, false_label); | 2373 __ B(lt, false_label); |
2374 __ B(eq, true_label); | 2374 __ B(eq, true_label); |
2375 __ Cmp(scratch1, LAST_SPEC_OBJECT_TYPE); | 2375 __ Cmp(scratch1, LAST_SPEC_OBJECT_TYPE); |
2376 __ B(eq, true_label); | 2376 __ B(eq, true_label); |
2377 } else { | 2377 } else { |
2378 __ IsObjectJSObjectType(input, map, scratch1, false_label); | 2378 __ IsObjectJSObjectType(input, map, scratch1, false_label); |
2379 } | 2379 } |
2380 | 2380 |
2381 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. | 2381 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. |
2382 // Check if the constructor in the map is a function. | 2382 // Check if the constructor in the map is a function. |
2383 __ Ldr(scratch1, FieldMemOperand(map, Map::kConstructorOffset)); | 2383 __ Ldr(scratch1, FieldMemOperand(map, Map::kConstructorOffset)); |
2384 | 2384 |
2385 // Objects with a non-function constructor have class 'Object'. | 2385 // Objects with a non-function constructor have class 'Object'. |
2386 if (class_name->IsUtf8EqualTo(CStrVector("Object"))) { | 2386 if (String::Equals(class_name, isolate()->factory()->Object_string())) { |
2387 __ JumpIfNotObjectType( | 2387 __ JumpIfNotObjectType( |
2388 scratch1, scratch2, scratch2, JS_FUNCTION_TYPE, true_label); | 2388 scratch1, scratch2, scratch2, JS_FUNCTION_TYPE, true_label); |
2389 } else { | 2389 } else { |
2390 __ JumpIfNotObjectType( | 2390 __ JumpIfNotObjectType( |
2391 scratch1, scratch2, scratch2, JS_FUNCTION_TYPE, false_label); | 2391 scratch1, scratch2, scratch2, JS_FUNCTION_TYPE, false_label); |
2392 } | 2392 } |
2393 | 2393 |
2394 // The constructor function is in scratch1. Get its instance class name. | 2394 // The constructor function is in scratch1. Get its instance class name. |
2395 __ Ldr(scratch1, | 2395 __ Ldr(scratch1, |
2396 FieldMemOperand(scratch1, JSFunction::kSharedFunctionInfoOffset)); | 2396 FieldMemOperand(scratch1, JSFunction::kSharedFunctionInfoOffset)); |
(...skipping 3649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6046 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6046 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6047 __ Push(scope_info); | 6047 __ Push(scope_info); |
6048 __ Push(ToRegister(instr->function())); | 6048 __ Push(ToRegister(instr->function())); |
6049 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6049 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6050 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6050 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6051 } | 6051 } |
6052 | 6052 |
6053 | 6053 |
6054 | 6054 |
6055 } } // namespace v8::internal | 6055 } } // namespace v8::internal |
OLD | NEW |