| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
| 8 | 8 |
| 9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
| 10 // | 10 // |
| (...skipping 3415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3426 VisitForAccumulatorValue(args->at(0)); | 3426 VisitForAccumulatorValue(args->at(0)); |
| 3427 | 3427 |
| 3428 Label materialize_true, materialize_false; | 3428 Label materialize_true, materialize_false; |
| 3429 Label* if_true = NULL; | 3429 Label* if_true = NULL; |
| 3430 Label* if_false = NULL; | 3430 Label* if_false = NULL; |
| 3431 Label* fall_through = NULL; | 3431 Label* fall_through = NULL; |
| 3432 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3432 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3433 &if_false, &fall_through); | 3433 &if_false, &fall_through); |
| 3434 | 3434 |
| 3435 __ JumpIfSmi(v0, if_false); | 3435 __ JumpIfSmi(v0, if_false); |
| 3436 Register map = a1; | 3436 __ GetObjectType(v0, a1, a1); |
| 3437 Register type_reg = a2; | |
| 3438 __ GetObjectType(v0, map, type_reg); | |
| 3439 __ Subu(type_reg, type_reg, Operand(FIRST_SIMD_VALUE_TYPE)); | |
| 3440 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3437 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3441 Split(ls, type_reg, Operand(LAST_SIMD_VALUE_TYPE - FIRST_SIMD_VALUE_TYPE), | 3438 Split(eq, a1, Operand(SIMD128_VALUE_TYPE), if_true, if_false, fall_through); |
| 3442 if_true, if_false, fall_through); | |
| 3443 | 3439 |
| 3444 context()->Plug(if_true, if_false); | 3440 context()->Plug(if_true, if_false); |
| 3445 } | 3441 } |
| 3446 | 3442 |
| 3447 | 3443 |
| 3448 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { | 3444 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { |
| 3449 ZoneList<Expression*>* args = expr->arguments(); | 3445 ZoneList<Expression*>* args = expr->arguments(); |
| 3450 DCHECK(args->length() == 1); | 3446 DCHECK(args->length() == 1); |
| 3451 | 3447 |
| 3452 VisitForAccumulatorValue(args->at(0)); | 3448 VisitForAccumulatorValue(args->at(0)); |
| (...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5067 __ GetObjectType(v0, v0, a1); | 5063 __ GetObjectType(v0, v0, a1); |
| 5068 __ Branch(if_false, ge, a1, Operand(FIRST_NONSTRING_TYPE)); | 5064 __ Branch(if_false, ge, a1, Operand(FIRST_NONSTRING_TYPE)); |
| 5069 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); | 5065 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); |
| 5070 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); | 5066 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); |
| 5071 Split(eq, a1, Operand(zero_reg), | 5067 Split(eq, a1, Operand(zero_reg), |
| 5072 if_true, if_false, fall_through); | 5068 if_true, if_false, fall_through); |
| 5073 } else if (String::Equals(check, factory->symbol_string())) { | 5069 } else if (String::Equals(check, factory->symbol_string())) { |
| 5074 __ JumpIfSmi(v0, if_false); | 5070 __ JumpIfSmi(v0, if_false); |
| 5075 __ GetObjectType(v0, v0, a1); | 5071 __ GetObjectType(v0, v0, a1); |
| 5076 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through); | 5072 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through); |
| 5077 } else if (String::Equals(check, factory->float32x4_string())) { | |
| 5078 __ JumpIfSmi(v0, if_false); | |
| 5079 __ GetObjectType(v0, v0, a1); | |
| 5080 Split(eq, a1, Operand(FLOAT32X4_TYPE), if_true, if_false, fall_through); | |
| 5081 } else if (String::Equals(check, factory->int32x4_string())) { | |
| 5082 __ JumpIfSmi(v0, if_false); | |
| 5083 __ GetObjectType(v0, v0, a1); | |
| 5084 Split(eq, a1, Operand(INT32X4_TYPE), if_true, if_false, fall_through); | |
| 5085 } else if (String::Equals(check, factory->bool32x4_string())) { | |
| 5086 __ JumpIfSmi(v0, if_false); | |
| 5087 __ GetObjectType(v0, v0, a1); | |
| 5088 Split(eq, a1, Operand(BOOL32X4_TYPE), if_true, if_false, fall_through); | |
| 5089 } else if (String::Equals(check, factory->int16x8_string())) { | |
| 5090 __ JumpIfSmi(v0, if_false); | |
| 5091 __ GetObjectType(v0, v0, a1); | |
| 5092 Split(eq, a1, Operand(INT16X8_TYPE), if_true, if_false, fall_through); | |
| 5093 } else if (String::Equals(check, factory->bool16x8_string())) { | |
| 5094 __ JumpIfSmi(v0, if_false); | |
| 5095 __ GetObjectType(v0, v0, a1); | |
| 5096 Split(eq, a1, Operand(BOOL16X8_TYPE), if_true, if_false, fall_through); | |
| 5097 } else if (String::Equals(check, factory->int8x16_string())) { | |
| 5098 __ JumpIfSmi(v0, if_false); | |
| 5099 __ GetObjectType(v0, v0, a1); | |
| 5100 Split(eq, a1, Operand(INT8X16_TYPE), if_true, if_false, fall_through); | |
| 5101 } else if (String::Equals(check, factory->bool8x16_string())) { | |
| 5102 __ JumpIfSmi(v0, if_false); | |
| 5103 __ GetObjectType(v0, v0, a1); | |
| 5104 Split(eq, a1, Operand(BOOL8X16_TYPE), if_true, if_false, fall_through); | |
| 5105 } else if (String::Equals(check, factory->boolean_string())) { | 5073 } else if (String::Equals(check, factory->boolean_string())) { |
| 5106 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 5074 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
| 5107 __ Branch(if_true, eq, v0, Operand(at)); | 5075 __ Branch(if_true, eq, v0, Operand(at)); |
| 5108 __ LoadRoot(at, Heap::kFalseValueRootIndex); | 5076 __ LoadRoot(at, Heap::kFalseValueRootIndex); |
| 5109 Split(eq, v0, Operand(at), if_true, if_false, fall_through); | 5077 Split(eq, v0, Operand(at), if_true, if_false, fall_through); |
| 5110 } else if (String::Equals(check, factory->undefined_string())) { | 5078 } else if (String::Equals(check, factory->undefined_string())) { |
| 5111 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 5079 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| 5112 __ Branch(if_true, eq, v0, Operand(at)); | 5080 __ Branch(if_true, eq, v0, Operand(at)); |
| 5113 __ JumpIfSmi(v0, if_false); | 5081 __ JumpIfSmi(v0, if_false); |
| 5114 // Check for undetectable objects => true. | 5082 // Check for undetectable objects => true. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 5129 __ Branch(if_true, eq, v0, Operand(at)); | 5097 __ Branch(if_true, eq, v0, Operand(at)); |
| 5130 // Check for JS objects => true. | 5098 // Check for JS objects => true. |
| 5131 __ GetObjectType(v0, v0, a1); | 5099 __ GetObjectType(v0, v0, a1); |
| 5132 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5100 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
| 5133 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset)); | 5101 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset)); |
| 5134 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5102 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
| 5135 // Check for undetectable objects => false. | 5103 // Check for undetectable objects => false. |
| 5136 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); | 5104 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); |
| 5137 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); | 5105 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); |
| 5138 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through); | 5106 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through); |
| 5107 // clang-format off |
| 5108 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 5109 } else if (String::Equals(check, factory->type##_string())) { \ |
| 5110 __ JumpIfSmi(v0, if_false); \ |
| 5111 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); \ |
| 5112 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ |
| 5113 Split(eq, v0, Operand(at), if_true, if_false, fall_through); |
| 5114 SIMD128_TYPES(SIMD128_TYPE) |
| 5115 #undef SIMD128_TYPE |
| 5116 // clang-format on |
| 5139 } else { | 5117 } else { |
| 5140 if (if_false != fall_through) __ jmp(if_false); | 5118 if (if_false != fall_through) __ jmp(if_false); |
| 5141 } | 5119 } |
| 5142 context()->Plug(if_true, if_false); | 5120 context()->Plug(if_true, if_false); |
| 5143 } | 5121 } |
| 5144 | 5122 |
| 5145 | 5123 |
| 5146 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 5124 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
| 5147 Comment cmnt(masm_, "[ CompareOperation"); | 5125 Comment cmnt(masm_, "[ CompareOperation"); |
| 5148 SetExpressionPosition(expr); | 5126 SetExpressionPosition(expr); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5434 reinterpret_cast<uint64_t>( | 5412 reinterpret_cast<uint64_t>( |
| 5435 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5413 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5436 return OSR_AFTER_STACK_CHECK; | 5414 return OSR_AFTER_STACK_CHECK; |
| 5437 } | 5415 } |
| 5438 | 5416 |
| 5439 | 5417 |
| 5440 } // namespace internal | 5418 } // namespace internal |
| 5441 } // namespace v8 | 5419 } // namespace v8 |
| 5442 | 5420 |
| 5443 #endif // V8_TARGET_ARCH_MIPS64 | 5421 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |