OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/arm/lithium-codegen-arm.h" | 5 #include "src/arm/lithium-codegen-arm.h" |
6 #include "src/arm/lithium-gap-resolver-arm.h" | 6 #include "src/arm/lithium-gap-resolver-arm.h" |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 5512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5523 __ CompareRoot(input, Heap::kUndefinedValueRootIndex); | 5523 __ CompareRoot(input, Heap::kUndefinedValueRootIndex); |
5524 __ b(eq, true_label); | 5524 __ b(eq, true_label); |
5525 __ JumpIfSmi(input, false_label); | 5525 __ JumpIfSmi(input, false_label); |
5526 // Check for undetectable objects => true. | 5526 // Check for undetectable objects => true. |
5527 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); | 5527 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
5528 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); | 5528 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5529 __ tst(scratch, Operand(1 << Map::kIsUndetectable)); | 5529 __ tst(scratch, Operand(1 << Map::kIsUndetectable)); |
5530 final_branch_condition = ne; | 5530 final_branch_condition = ne; |
5531 | 5531 |
5532 } else if (String::Equals(type_name, factory->function_string())) { | 5532 } else if (String::Equals(type_name, factory->function_string())) { |
5533 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | |
5534 Register type_reg = scratch; | |
5535 __ JumpIfSmi(input, false_label); | 5533 __ JumpIfSmi(input, false_label); |
5536 __ CompareObjectType(input, scratch, type_reg, JS_FUNCTION_TYPE); | 5534 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
5537 __ b(eq, true_label); | 5535 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5538 __ cmp(type_reg, Operand(JS_FUNCTION_PROXY_TYPE)); | 5536 __ and_(scratch, scratch, |
| 5537 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
| 5538 __ cmp(scratch, Operand(1 << Map::kIsCallable)); |
5539 final_branch_condition = eq; | 5539 final_branch_condition = eq; |
5540 | 5540 |
5541 } else if (String::Equals(type_name, factory->object_string())) { | 5541 } else if (String::Equals(type_name, factory->object_string())) { |
5542 Register map = scratch; | |
5543 __ JumpIfSmi(input, false_label); | 5542 __ JumpIfSmi(input, false_label); |
5544 __ CompareRoot(input, Heap::kNullValueRootIndex); | 5543 __ CompareRoot(input, Heap::kNullValueRootIndex); |
5545 __ b(eq, true_label); | 5544 __ b(eq, true_label); |
5546 __ CheckObjectTypeRange(input, | 5545 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
5547 map, | 5546 __ CompareObjectType(input, scratch, ip, FIRST_SPEC_OBJECT_TYPE); |
5548 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, | 5547 __ b(lt, false_label); |
5549 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, | 5548 // Check for callable or undetectable objects => false. |
5550 false_label); | 5549 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
5551 // Check for undetectable objects => false. | 5550 __ tst(scratch, |
5552 __ ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); | 5551 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5553 __ tst(scratch, Operand(1 << Map::kIsUndetectable)); | |
5554 final_branch_condition = eq; | 5552 final_branch_condition = eq; |
5555 | 5553 |
5556 // clang-format off | 5554 // clang-format off |
5557 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 5555 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
5558 } else if (String::Equals(type_name, factory->type##_string())) { \ | 5556 } else if (String::Equals(type_name, factory->type##_string())) { \ |
5559 __ JumpIfSmi(input, false_label); \ | 5557 __ JumpIfSmi(input, false_label); \ |
5560 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \ | 5558 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \ |
5561 __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \ | 5559 __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \ |
5562 final_branch_condition = eq; | 5560 final_branch_condition = eq; |
5563 SIMD128_TYPES(SIMD128_TYPE) | 5561 SIMD128_TYPES(SIMD128_TYPE) |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5873 __ push(ToRegister(instr->function())); | 5871 __ push(ToRegister(instr->function())); |
5874 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5872 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5875 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5873 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5876 } | 5874 } |
5877 | 5875 |
5878 | 5876 |
5879 #undef __ | 5877 #undef __ |
5880 | 5878 |
5881 } // namespace internal | 5879 } // namespace internal |
5882 } // namespace v8 | 5880 } // namespace v8 |
OLD | NEW |