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 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
6 | 6 |
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/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 2478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2489 // the temp registers, but not the input. | 2489 // the temp registers, but not the input. |
2490 void LCodeGen::EmitClassOfTest(Label* is_true, Label* is_false, | 2490 void LCodeGen::EmitClassOfTest(Label* is_true, Label* is_false, |
2491 Handle<String> class_name, Register input, | 2491 Handle<String> class_name, Register input, |
2492 Register temp, Register temp2) { | 2492 Register temp, Register temp2) { |
2493 DCHECK(!input.is(temp)); | 2493 DCHECK(!input.is(temp)); |
2494 DCHECK(!input.is(temp2)); | 2494 DCHECK(!input.is(temp2)); |
2495 DCHECK(!temp.is(temp2)); | 2495 DCHECK(!temp.is(temp2)); |
2496 | 2496 |
2497 __ JumpIfSmi(input, is_false); | 2497 __ JumpIfSmi(input, is_false); |
2498 | 2498 |
2499 __ CompareObjectType(input, temp, temp2, JS_FUNCTION_TYPE); | 2499 __ CompareObjectType(input, temp, temp2, FIRST_FUNCTION_TYPE); |
| 2500 STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE); |
2500 if (String::Equals(isolate()->factory()->Function_string(), class_name)) { | 2501 if (String::Equals(isolate()->factory()->Function_string(), class_name)) { |
2501 __ beq(is_true); | 2502 __ bge(is_true); |
2502 } else { | 2503 } else { |
2503 __ beq(is_false); | 2504 __ bge(is_false); |
2504 } | 2505 } |
2505 | 2506 |
2506 // Check if the constructor in the map is a function. | 2507 // Check if the constructor in the map is a function. |
2507 Register instance_type = ip; | 2508 Register instance_type = ip; |
2508 __ GetMapConstructor(temp, temp, temp2, instance_type); | 2509 __ GetMapConstructor(temp, temp, temp2, instance_type); |
2509 | 2510 |
2510 // Objects with a non-function constructor have class 'Object'. | 2511 // Objects with a non-function constructor have class 'Object'. |
2511 __ cmpi(instance_type, Operand(JS_FUNCTION_TYPE)); | 2512 __ cmpi(instance_type, Operand(JS_FUNCTION_TYPE)); |
2512 if (String::Equals(isolate()->factory()->Object_string(), class_name)) { | 2513 if (String::Equals(isolate()->factory()->Object_string(), class_name)) { |
2513 __ bne(is_true); | 2514 __ bne(is_true); |
(...skipping 3237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5751 __ LoadP(result, | 5752 __ LoadP(result, |
5752 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5753 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5753 __ bind(deferred->exit()); | 5754 __ bind(deferred->exit()); |
5754 __ bind(&done); | 5755 __ bind(&done); |
5755 } | 5756 } |
5756 | 5757 |
5757 #undef __ | 5758 #undef __ |
5758 | 5759 |
5759 } // namespace internal | 5760 } // namespace internal |
5760 } // namespace v8 | 5761 } // namespace v8 |
OLD | NEW |