OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 4991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5002 __ beq(if_true); | 5002 __ beq(if_true); |
5003 __ JumpIfSmi(r3, if_false); | 5003 __ JumpIfSmi(r3, if_false); |
5004 // Check for undetectable objects => true. | 5004 // Check for undetectable objects => true. |
5005 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); | 5005 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); |
5006 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); | 5006 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); |
5007 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); | 5007 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); |
5008 Split(ne, if_true, if_false, fall_through, cr0); | 5008 Split(ne, if_true, if_false, fall_through, cr0); |
5009 | 5009 |
5010 } else if (String::Equals(check, factory->function_string())) { | 5010 } else if (String::Equals(check, factory->function_string())) { |
5011 __ JumpIfSmi(r3, if_false); | 5011 __ JumpIfSmi(r3, if_false); |
5012 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 5012 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); |
5013 __ CompareObjectType(r3, r3, r4, JS_FUNCTION_TYPE); | 5013 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); |
5014 __ beq(if_true); | 5014 __ andi(r4, r4, |
5015 __ cmpi(r4, Operand(JS_FUNCTION_PROXY_TYPE)); | 5015 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
| 5016 __ cmpi(r4, Operand(1 << Map::kIsCallable)); |
5016 Split(eq, if_true, if_false, fall_through); | 5017 Split(eq, if_true, if_false, fall_through); |
5017 } else if (String::Equals(check, factory->object_string())) { | 5018 } else if (String::Equals(check, factory->object_string())) { |
5018 __ JumpIfSmi(r3, if_false); | 5019 __ JumpIfSmi(r3, if_false); |
5019 __ CompareRoot(r3, Heap::kNullValueRootIndex); | 5020 __ CompareRoot(r3, Heap::kNullValueRootIndex); |
5020 __ beq(if_true); | 5021 __ beq(if_true); |
5021 // Check for JS objects => true. | 5022 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
5022 __ CompareObjectType(r3, r3, r4, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5023 __ CompareObjectType(r3, r3, r4, FIRST_SPEC_OBJECT_TYPE); |
5023 __ blt(if_false); | 5024 __ blt(if_false); |
5024 __ CompareInstanceType(r3, r4, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5025 // Check for callable or undetectable objects => false. |
5025 __ bgt(if_false); | |
5026 // Check for undetectable objects => false. | |
5027 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); | 5026 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); |
5028 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); | 5027 __ andi(r0, r4, |
| 5028 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
5029 Split(eq, if_true, if_false, fall_through, cr0); | 5029 Split(eq, if_true, if_false, fall_through, cr0); |
5030 // clang-format off | 5030 // clang-format off |
5031 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 5031 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
5032 } else if (String::Equals(check, factory->type##_string())) { \ | 5032 } else if (String::Equals(check, factory->type##_string())) { \ |
5033 __ JumpIfSmi(r3, if_false); \ | 5033 __ JumpIfSmi(r3, if_false); \ |
5034 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); \ | 5034 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); \ |
5035 __ CompareRoot(r3, Heap::k##Type##MapRootIndex); \ | 5035 __ CompareRoot(r3, Heap::k##Type##MapRootIndex); \ |
5036 Split(eq, if_true, if_false, fall_through); | 5036 Split(eq, if_true, if_false, fall_through); |
5037 SIMD128_TYPES(SIMD128_TYPE) | 5037 SIMD128_TYPES(SIMD128_TYPE) |
5038 #undef SIMD128_TYPE | 5038 #undef SIMD128_TYPE |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5322 return ON_STACK_REPLACEMENT; | 5322 return ON_STACK_REPLACEMENT; |
5323 } | 5323 } |
5324 | 5324 |
5325 DCHECK(interrupt_address == | 5325 DCHECK(interrupt_address == |
5326 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5326 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5327 return OSR_AFTER_STACK_CHECK; | 5327 return OSR_AFTER_STACK_CHECK; |
5328 } | 5328 } |
5329 } // namespace internal | 5329 } // namespace internal |
5330 } // namespace v8 | 5330 } // namespace v8 |
5331 #endif // V8_TARGET_ARCH_PPC | 5331 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |