| 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 3414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3425 VisitForAccumulatorValue(args->at(0)); | 3425 VisitForAccumulatorValue(args->at(0)); |
| 3426 | 3426 |
| 3427 Label materialize_true, materialize_false; | 3427 Label materialize_true, materialize_false; |
| 3428 Label* if_true = NULL; | 3428 Label* if_true = NULL; |
| 3429 Label* if_false = NULL; | 3429 Label* if_false = NULL; |
| 3430 Label* fall_through = NULL; | 3430 Label* fall_through = NULL; |
| 3431 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3431 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3432 &if_false, &fall_through); | 3432 &if_false, &fall_through); |
| 3433 | 3433 |
| 3434 __ JumpIfSmi(r3, if_false); | 3434 __ JumpIfSmi(r3, if_false); |
| 3435 Register map = r4; | 3435 __ CompareObjectType(r3, r4, r4, SIMD128_VALUE_TYPE); |
| 3436 Register type_reg = r5; | |
| 3437 __ LoadP(map, FieldMemOperand(r3, HeapObject::kMapOffset)); | |
| 3438 __ lbz(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); | |
| 3439 __ subi(type_reg, type_reg, Operand(FIRST_SIMD_VALUE_TYPE)); | |
| 3440 __ cmpli(type_reg, Operand(LAST_SIMD_VALUE_TYPE - FIRST_SIMD_VALUE_TYPE)); | |
| 3441 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3436 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3442 Split(le, if_true, if_false, fall_through); | 3437 Split(eq, if_true, if_false, fall_through); |
| 3443 | 3438 |
| 3444 context()->Plug(if_true, if_false); | 3439 context()->Plug(if_true, if_false); |
| 3445 } | 3440 } |
| 3446 | 3441 |
| 3447 | 3442 |
| 3448 void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( | 3443 void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( |
| 3449 CallRuntime* expr) { | 3444 CallRuntime* expr) { |
| 3450 ZoneList<Expression*>* args = expr->arguments(); | 3445 ZoneList<Expression*>* args = expr->arguments(); |
| 3451 DCHECK(args->length() == 1); | 3446 DCHECK(args->length() == 1); |
| 3452 | 3447 |
| (...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5022 | 5017 |
| 5023 Factory* factory = isolate()->factory(); | 5018 Factory* factory = isolate()->factory(); |
| 5024 if (String::Equals(check, factory->number_string())) { | 5019 if (String::Equals(check, factory->number_string())) { |
| 5025 __ JumpIfSmi(r3, if_true); | 5020 __ JumpIfSmi(r3, if_true); |
| 5026 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); | 5021 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); |
| 5027 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); | 5022 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); |
| 5028 __ cmp(r3, ip); | 5023 __ cmp(r3, ip); |
| 5029 Split(eq, if_true, if_false, fall_through); | 5024 Split(eq, if_true, if_false, fall_through); |
| 5030 } else if (String::Equals(check, factory->string_string())) { | 5025 } else if (String::Equals(check, factory->string_string())) { |
| 5031 __ JumpIfSmi(r3, if_false); | 5026 __ JumpIfSmi(r3, if_false); |
| 5032 // Check for undetectable objects => false. | |
| 5033 __ CompareObjectType(r3, r3, r4, FIRST_NONSTRING_TYPE); | 5027 __ CompareObjectType(r3, r3, r4, FIRST_NONSTRING_TYPE); |
| 5034 __ bge(if_false); | 5028 Split(lt, if_true, if_false, fall_through); |
| 5035 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); | |
| 5036 STATIC_ASSERT((1 << Map::kIsUndetectable) < 0x8000); | |
| 5037 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); | |
| 5038 Split(eq, if_true, if_false, fall_through, cr0); | |
| 5039 } else if (String::Equals(check, factory->symbol_string())) { | 5029 } else if (String::Equals(check, factory->symbol_string())) { |
| 5040 __ JumpIfSmi(r3, if_false); | 5030 __ JumpIfSmi(r3, if_false); |
| 5041 __ CompareObjectType(r3, r3, r4, SYMBOL_TYPE); | 5031 __ CompareObjectType(r3, r3, r4, SYMBOL_TYPE); |
| 5042 Split(eq, if_true, if_false, fall_through); | 5032 Split(eq, if_true, if_false, fall_through); |
| 5043 } else if (String::Equals(check, factory->float32x4_string())) { | |
| 5044 __ JumpIfSmi(r3, if_false); | |
| 5045 __ CompareObjectType(r3, r3, r4, FLOAT32X4_TYPE); | |
| 5046 Split(eq, if_true, if_false, fall_through); | |
| 5047 } else if (String::Equals(check, factory->int32x4_string())) { | |
| 5048 __ JumpIfSmi(r3, if_false); | |
| 5049 __ CompareObjectType(r3, r3, r4, INT32X4_TYPE); | |
| 5050 Split(eq, if_true, if_false, fall_through); | |
| 5051 } else if (String::Equals(check, factory->bool32x4_string())) { | |
| 5052 __ JumpIfSmi(r3, if_false); | |
| 5053 __ CompareObjectType(r3, r3, r4, BOOL32X4_TYPE); | |
| 5054 Split(eq, if_true, if_false, fall_through); | |
| 5055 } else if (String::Equals(check, factory->int16x8_string())) { | |
| 5056 __ JumpIfSmi(r3, if_false); | |
| 5057 __ CompareObjectType(r3, r3, r4, INT16X8_TYPE); | |
| 5058 Split(eq, if_true, if_false, fall_through); | |
| 5059 } else if (String::Equals(check, factory->bool16x8_string())) { | |
| 5060 __ JumpIfSmi(r3, if_false); | |
| 5061 __ CompareObjectType(r3, r3, r4, BOOL16X8_TYPE); | |
| 5062 Split(eq, if_true, if_false, fall_through); | |
| 5063 } else if (String::Equals(check, factory->int8x16_string())) { | |
| 5064 __ JumpIfSmi(r3, if_false); | |
| 5065 __ CompareObjectType(r3, r3, r4, INT8X16_TYPE); | |
| 5066 Split(eq, if_true, if_false, fall_through); | |
| 5067 } else if (String::Equals(check, factory->bool8x16_string())) { | |
| 5068 __ JumpIfSmi(r3, if_false); | |
| 5069 __ CompareObjectType(r3, r3, r4, BOOL8X16_TYPE); | |
| 5070 Split(eq, if_true, if_false, fall_through); | |
| 5071 } else if (String::Equals(check, factory->boolean_string())) { | 5033 } else if (String::Equals(check, factory->boolean_string())) { |
| 5072 __ CompareRoot(r3, Heap::kTrueValueRootIndex); | 5034 __ CompareRoot(r3, Heap::kTrueValueRootIndex); |
| 5073 __ beq(if_true); | 5035 __ beq(if_true); |
| 5074 __ CompareRoot(r3, Heap::kFalseValueRootIndex); | 5036 __ CompareRoot(r3, Heap::kFalseValueRootIndex); |
| 5075 Split(eq, if_true, if_false, fall_through); | 5037 Split(eq, if_true, if_false, fall_through); |
| 5076 } else if (String::Equals(check, factory->undefined_string())) { | 5038 } else if (String::Equals(check, factory->undefined_string())) { |
| 5077 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); | 5039 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); |
| 5078 __ beq(if_true); | 5040 __ beq(if_true); |
| 5079 __ JumpIfSmi(r3, if_false); | 5041 __ JumpIfSmi(r3, if_false); |
| 5080 // Check for undetectable objects => true. | 5042 // Check for undetectable objects => true. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5096 __ beq(if_true); | 5058 __ beq(if_true); |
| 5097 // Check for JS objects => true. | 5059 // Check for JS objects => true. |
| 5098 __ CompareObjectType(r3, r3, r4, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5060 __ CompareObjectType(r3, r3, r4, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 5099 __ blt(if_false); | 5061 __ blt(if_false); |
| 5100 __ CompareInstanceType(r3, r4, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5062 __ CompareInstanceType(r3, r4, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 5101 __ bgt(if_false); | 5063 __ bgt(if_false); |
| 5102 // Check for undetectable objects => false. | 5064 // Check for undetectable objects => false. |
| 5103 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); | 5065 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); |
| 5104 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); | 5066 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); |
| 5105 Split(eq, if_true, if_false, fall_through, cr0); | 5067 Split(eq, if_true, if_false, fall_through, cr0); |
| 5068 // clang-format off |
| 5069 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 5070 } else if (String::Equals(check, factory->type##_string())) { \ |
| 5071 __ JumpIfSmi(r3, if_false); \ |
| 5072 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); \ |
| 5073 __ CompareRoot(r3, Heap::k##Type##MapRootIndex); \ |
| 5074 Split(eq, if_true, if_false, fall_through); |
| 5075 SIMD128_TYPES(SIMD128_TYPE) |
| 5076 #undef SIMD128_TYPE |
| 5077 // clang-format on |
| 5106 } else { | 5078 } else { |
| 5107 if (if_false != fall_through) __ b(if_false); | 5079 if (if_false != fall_through) __ b(if_false); |
| 5108 } | 5080 } |
| 5109 context()->Plug(if_true, if_false); | 5081 context()->Plug(if_true, if_false); |
| 5110 } | 5082 } |
| 5111 | 5083 |
| 5112 | 5084 |
| 5113 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 5085 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
| 5114 Comment cmnt(masm_, "[ CompareOperation"); | 5086 Comment cmnt(masm_, "[ CompareOperation"); |
| 5115 SetExpressionPosition(expr); | 5087 SetExpressionPosition(expr); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5389 return ON_STACK_REPLACEMENT; | 5361 return ON_STACK_REPLACEMENT; |
| 5390 } | 5362 } |
| 5391 | 5363 |
| 5392 DCHECK(interrupt_address == | 5364 DCHECK(interrupt_address == |
| 5393 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5365 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5394 return OSR_AFTER_STACK_CHECK; | 5366 return OSR_AFTER_STACK_CHECK; |
| 5395 } | 5367 } |
| 5396 } // namespace internal | 5368 } // namespace internal |
| 5397 } // namespace v8 | 5369 } // namespace v8 |
| 5398 #endif // V8_TARGET_ARCH_PPC | 5370 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |