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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 3404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3415 | 3415 |
3416 __ JumpIfSmi(r3, if_false); | 3416 __ JumpIfSmi(r3, if_false); |
3417 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE); | 3417 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE); |
3418 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3418 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3419 Split(ge, if_true, if_false, fall_through); | 3419 Split(ge, if_true, if_false, fall_through); |
3420 | 3420 |
3421 context()->Plug(if_true, if_false); | 3421 context()->Plug(if_true, if_false); |
3422 } | 3422 } |
3423 | 3423 |
3424 | 3424 |
| 3425 void FullCodeGenerator::EmitIsSimdObject(CallRuntime* expr) { |
| 3426 ZoneList<Expression*>* args = expr->arguments(); |
| 3427 DCHECK(args->length() == 1); |
| 3428 |
| 3429 VisitForAccumulatorValue(args->at(0)); |
| 3430 |
| 3431 Label materialize_true, materialize_false; |
| 3432 Label* if_true = NULL; |
| 3433 Label* if_false = NULL; |
| 3434 Label* fall_through = NULL; |
| 3435 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3436 &if_false, &fall_through); |
| 3437 |
| 3438 __ JumpIfSmi(r3, if_false); |
| 3439 Register map = r4; |
| 3440 Register type_reg = r5; |
| 3441 __ LoadP(map, FieldMemOperand(r3, HeapObject::kMapOffset)); |
| 3442 __ lbz(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 3443 __ subi(type_reg, type_reg, Operand(FIRST_SIMD_VALUE_TYPE)); |
| 3444 __ cmpli(type_reg, Operand(LAST_SIMD_VALUE_TYPE - FIRST_SIMD_VALUE_TYPE)); |
| 3445 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3446 Split(le, if_true, if_false, fall_through); |
| 3447 |
| 3448 context()->Plug(if_true, if_false); |
| 3449 } |
| 3450 |
| 3451 |
3425 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { | 3452 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { |
3426 ZoneList<Expression*>* args = expr->arguments(); | 3453 ZoneList<Expression*>* args = expr->arguments(); |
3427 DCHECK(args->length() == 1); | 3454 DCHECK(args->length() == 1); |
3428 | 3455 |
3429 VisitForAccumulatorValue(args->at(0)); | 3456 VisitForAccumulatorValue(args->at(0)); |
3430 | 3457 |
3431 Label materialize_true, materialize_false; | 3458 Label materialize_true, materialize_false; |
3432 Label* if_true = NULL; | 3459 Label* if_true = NULL; |
3433 Label* if_false = NULL; | 3460 Label* if_false = NULL; |
3434 Label* fall_through = NULL; | 3461 Label* fall_through = NULL; |
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5076 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); | 5103 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); |
5077 Split(eq, if_true, if_false, fall_through, cr0); | 5104 Split(eq, if_true, if_false, fall_through, cr0); |
5078 } else if (String::Equals(check, factory->symbol_string())) { | 5105 } else if (String::Equals(check, factory->symbol_string())) { |
5079 __ JumpIfSmi(r3, if_false); | 5106 __ JumpIfSmi(r3, if_false); |
5080 __ CompareObjectType(r3, r3, r4, SYMBOL_TYPE); | 5107 __ CompareObjectType(r3, r3, r4, SYMBOL_TYPE); |
5081 Split(eq, if_true, if_false, fall_through); | 5108 Split(eq, if_true, if_false, fall_through); |
5082 } else if (String::Equals(check, factory->float32x4_string())) { | 5109 } else if (String::Equals(check, factory->float32x4_string())) { |
5083 __ JumpIfSmi(r3, if_false); | 5110 __ JumpIfSmi(r3, if_false); |
5084 __ CompareObjectType(r3, r3, r4, FLOAT32X4_TYPE); | 5111 __ CompareObjectType(r3, r3, r4, FLOAT32X4_TYPE); |
5085 Split(eq, if_true, if_false, fall_through); | 5112 Split(eq, if_true, if_false, fall_through); |
| 5113 } else if (String::Equals(check, factory->int32x4_string())) { |
| 5114 __ JumpIfSmi(r3, if_false); |
| 5115 __ CompareObjectType(r3, r3, r4, INT32X4_TYPE); |
| 5116 Split(eq, if_true, if_false, fall_through); |
| 5117 } else if (String::Equals(check, factory->bool32x4_string())) { |
| 5118 __ JumpIfSmi(r3, if_false); |
| 5119 __ CompareObjectType(r3, r3, r4, BOOL32X4_TYPE); |
| 5120 Split(eq, if_true, if_false, fall_through); |
| 5121 } else if (String::Equals(check, factory->int16x8_string())) { |
| 5122 __ JumpIfSmi(r3, if_false); |
| 5123 __ CompareObjectType(r3, r3, r4, INT16X8_TYPE); |
| 5124 Split(eq, if_true, if_false, fall_through); |
| 5125 } else if (String::Equals(check, factory->bool16x8_string())) { |
| 5126 __ JumpIfSmi(r3, if_false); |
| 5127 __ CompareObjectType(r3, r3, r4, BOOL16X8_TYPE); |
| 5128 Split(eq, if_true, if_false, fall_through); |
| 5129 } else if (String::Equals(check, factory->int8x16_string())) { |
| 5130 __ JumpIfSmi(r3, if_false); |
| 5131 __ CompareObjectType(r3, r3, r4, INT8X16_TYPE); |
| 5132 Split(eq, if_true, if_false, fall_through); |
| 5133 } else if (String::Equals(check, factory->bool8x16_string())) { |
| 5134 __ JumpIfSmi(r3, if_false); |
| 5135 __ CompareObjectType(r3, r3, r4, BOOL8X16_TYPE); |
| 5136 Split(eq, if_true, if_false, fall_through); |
5086 } else if (String::Equals(check, factory->boolean_string())) { | 5137 } else if (String::Equals(check, factory->boolean_string())) { |
5087 __ CompareRoot(r3, Heap::kTrueValueRootIndex); | 5138 __ CompareRoot(r3, Heap::kTrueValueRootIndex); |
5088 __ beq(if_true); | 5139 __ beq(if_true); |
5089 __ CompareRoot(r3, Heap::kFalseValueRootIndex); | 5140 __ CompareRoot(r3, Heap::kFalseValueRootIndex); |
5090 Split(eq, if_true, if_false, fall_through); | 5141 Split(eq, if_true, if_false, fall_through); |
5091 } else if (String::Equals(check, factory->undefined_string())) { | 5142 } else if (String::Equals(check, factory->undefined_string())) { |
5092 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); | 5143 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); |
5093 __ beq(if_true); | 5144 __ beq(if_true); |
5094 __ JumpIfSmi(r3, if_false); | 5145 __ JumpIfSmi(r3, if_false); |
5095 // Check for undetectable objects => true. | 5146 // Check for undetectable objects => true. |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5404 return ON_STACK_REPLACEMENT; | 5455 return ON_STACK_REPLACEMENT; |
5405 } | 5456 } |
5406 | 5457 |
5407 DCHECK(interrupt_address == | 5458 DCHECK(interrupt_address == |
5408 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5459 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5409 return OSR_AFTER_STACK_CHECK; | 5460 return OSR_AFTER_STACK_CHECK; |
5410 } | 5461 } |
5411 } // namespace internal | 5462 } // namespace internal |
5412 } // namespace v8 | 5463 } // namespace v8 |
5413 #endif // V8_TARGET_ARCH_PPC | 5464 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |