| 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 3381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3392 VisitForAccumulatorValue(args->at(0)); | 3392 VisitForAccumulatorValue(args->at(0)); |
| 3393 | 3393 |
| 3394 Label materialize_true, materialize_false; | 3394 Label materialize_true, materialize_false; |
| 3395 Label* if_true = NULL; | 3395 Label* if_true = NULL; |
| 3396 Label* if_false = NULL; | 3396 Label* if_false = NULL; |
| 3397 Label* fall_through = NULL; | 3397 Label* fall_through = NULL; |
| 3398 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3398 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3399 &if_false, &fall_through); | 3399 &if_false, &fall_through); |
| 3400 | 3400 |
| 3401 __ JumpIfSmi(r3, if_false); | 3401 __ JumpIfSmi(r3, if_false); |
| 3402 Register map = r4; | 3402 __ CompareObjectType(r3, r4, r4, SIMD128_VALUE_TYPE); |
| 3403 Register type_reg = r5; | |
| 3404 __ LoadP(map, FieldMemOperand(r3, HeapObject::kMapOffset)); | |
| 3405 __ lbz(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); | |
| 3406 __ subi(type_reg, type_reg, Operand(FIRST_SIMD_VALUE_TYPE)); | |
| 3407 __ cmpli(type_reg, Operand(LAST_SIMD_VALUE_TYPE - FIRST_SIMD_VALUE_TYPE)); | |
| 3408 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3403 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3409 Split(le, if_true, if_false, fall_through); | 3404 Split(eq, if_true, if_false, fall_through); |
| 3410 | 3405 |
| 3411 context()->Plug(if_true, if_false); | 3406 context()->Plug(if_true, if_false); |
| 3412 } | 3407 } |
| 3413 | 3408 |
| 3414 | 3409 |
| 3415 void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( | 3410 void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( |
| 3416 CallRuntime* expr) { | 3411 CallRuntime* expr) { |
| 3417 ZoneList<Expression*>* args = expr->arguments(); | 3412 ZoneList<Expression*>* args = expr->arguments(); |
| 3418 DCHECK(args->length() == 1); | 3413 DCHECK(args->length() == 1); |
| 3419 | 3414 |
| (...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4996 __ CompareObjectType(r3, r3, r4, FIRST_NONSTRING_TYPE); | 4991 __ CompareObjectType(r3, r3, r4, FIRST_NONSTRING_TYPE); |
| 4997 __ bge(if_false); | 4992 __ bge(if_false); |
| 4998 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); | 4993 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); |
| 4999 STATIC_ASSERT((1 << Map::kIsUndetectable) < 0x8000); | 4994 STATIC_ASSERT((1 << Map::kIsUndetectable) < 0x8000); |
| 5000 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); | 4995 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); |
| 5001 Split(eq, if_true, if_false, fall_through, cr0); | 4996 Split(eq, if_true, if_false, fall_through, cr0); |
| 5002 } else if (String::Equals(check, factory->symbol_string())) { | 4997 } else if (String::Equals(check, factory->symbol_string())) { |
| 5003 __ JumpIfSmi(r3, if_false); | 4998 __ JumpIfSmi(r3, if_false); |
| 5004 __ CompareObjectType(r3, r3, r4, SYMBOL_TYPE); | 4999 __ CompareObjectType(r3, r3, r4, SYMBOL_TYPE); |
| 5005 Split(eq, if_true, if_false, fall_through); | 5000 Split(eq, if_true, if_false, fall_through); |
| 5006 } else if (String::Equals(check, factory->float32x4_string())) { | |
| 5007 __ JumpIfSmi(r3, if_false); | |
| 5008 __ CompareObjectType(r3, r3, r4, FLOAT32X4_TYPE); | |
| 5009 Split(eq, if_true, if_false, fall_through); | |
| 5010 } else if (String::Equals(check, factory->int32x4_string())) { | |
| 5011 __ JumpIfSmi(r3, if_false); | |
| 5012 __ CompareObjectType(r3, r3, r4, INT32X4_TYPE); | |
| 5013 Split(eq, if_true, if_false, fall_through); | |
| 5014 } else if (String::Equals(check, factory->bool32x4_string())) { | |
| 5015 __ JumpIfSmi(r3, if_false); | |
| 5016 __ CompareObjectType(r3, r3, r4, BOOL32X4_TYPE); | |
| 5017 Split(eq, if_true, if_false, fall_through); | |
| 5018 } else if (String::Equals(check, factory->int16x8_string())) { | |
| 5019 __ JumpIfSmi(r3, if_false); | |
| 5020 __ CompareObjectType(r3, r3, r4, INT16X8_TYPE); | |
| 5021 Split(eq, if_true, if_false, fall_through); | |
| 5022 } else if (String::Equals(check, factory->bool16x8_string())) { | |
| 5023 __ JumpIfSmi(r3, if_false); | |
| 5024 __ CompareObjectType(r3, r3, r4, BOOL16X8_TYPE); | |
| 5025 Split(eq, if_true, if_false, fall_through); | |
| 5026 } else if (String::Equals(check, factory->int8x16_string())) { | |
| 5027 __ JumpIfSmi(r3, if_false); | |
| 5028 __ CompareObjectType(r3, r3, r4, INT8X16_TYPE); | |
| 5029 Split(eq, if_true, if_false, fall_through); | |
| 5030 } else if (String::Equals(check, factory->bool8x16_string())) { | |
| 5031 __ JumpIfSmi(r3, if_false); | |
| 5032 __ CompareObjectType(r3, r3, r4, BOOL8X16_TYPE); | |
| 5033 Split(eq, if_true, if_false, fall_through); | |
| 5034 } else if (String::Equals(check, factory->boolean_string())) { | 5001 } else if (String::Equals(check, factory->boolean_string())) { |
| 5035 __ CompareRoot(r3, Heap::kTrueValueRootIndex); | 5002 __ CompareRoot(r3, Heap::kTrueValueRootIndex); |
| 5036 __ beq(if_true); | 5003 __ beq(if_true); |
| 5037 __ CompareRoot(r3, Heap::kFalseValueRootIndex); | 5004 __ CompareRoot(r3, Heap::kFalseValueRootIndex); |
| 5038 Split(eq, if_true, if_false, fall_through); | 5005 Split(eq, if_true, if_false, fall_through); |
| 5039 } else if (String::Equals(check, factory->undefined_string())) { | 5006 } else if (String::Equals(check, factory->undefined_string())) { |
| 5040 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); | 5007 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); |
| 5041 __ beq(if_true); | 5008 __ beq(if_true); |
| 5042 __ JumpIfSmi(r3, if_false); | 5009 __ JumpIfSmi(r3, if_false); |
| 5043 // Check for undetectable objects => true. | 5010 // Check for undetectable objects => true. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5059 __ beq(if_true); | 5026 __ beq(if_true); |
| 5060 // Check for JS objects => true. | 5027 // Check for JS objects => true. |
| 5061 __ CompareObjectType(r3, r3, r4, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5028 __ CompareObjectType(r3, r3, r4, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 5062 __ blt(if_false); | 5029 __ blt(if_false); |
| 5063 __ CompareInstanceType(r3, r4, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5030 __ CompareInstanceType(r3, r4, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 5064 __ bgt(if_false); | 5031 __ bgt(if_false); |
| 5065 // Check for undetectable objects => false. | 5032 // Check for undetectable objects => false. |
| 5066 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); | 5033 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); |
| 5067 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); | 5034 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); |
| 5068 Split(eq, if_true, if_false, fall_through, cr0); | 5035 Split(eq, if_true, if_false, fall_through, cr0); |
| 5036 // clang-format off |
| 5037 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 5038 } else if (String::Equals(check, factory->type##_string())) { \ |
| 5039 __ JumpIfSmi(r3, if_false); \ |
| 5040 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); \ |
| 5041 __ CompareRoot(r3, Heap::k##Type##MapRootIndex); \ |
| 5042 Split(eq, if_true, if_false, fall_through); |
| 5043 SIMD128_TYPES(SIMD128_TYPE) |
| 5044 #undef SIMD128_TYPE |
| 5045 // clang-format on |
| 5069 } else { | 5046 } else { |
| 5070 if (if_false != fall_through) __ b(if_false); | 5047 if (if_false != fall_through) __ b(if_false); |
| 5071 } | 5048 } |
| 5072 context()->Plug(if_true, if_false); | 5049 context()->Plug(if_true, if_false); |
| 5073 } | 5050 } |
| 5074 | 5051 |
| 5075 | 5052 |
| 5076 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 5053 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
| 5077 Comment cmnt(masm_, "[ CompareOperation"); | 5054 Comment cmnt(masm_, "[ CompareOperation"); |
| 5078 SetExpressionPosition(expr); | 5055 SetExpressionPosition(expr); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5352 return ON_STACK_REPLACEMENT; | 5329 return ON_STACK_REPLACEMENT; |
| 5353 } | 5330 } |
| 5354 | 5331 |
| 5355 DCHECK(interrupt_address == | 5332 DCHECK(interrupt_address == |
| 5356 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5333 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5357 return OSR_AFTER_STACK_CHECK; | 5334 return OSR_AFTER_STACK_CHECK; |
| 5358 } | 5335 } |
| 5359 } // namespace internal | 5336 } // namespace internal |
| 5360 } // namespace v8 | 5337 } // namespace v8 |
| 5361 #endif // V8_TARGET_ARCH_PPC | 5338 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |