Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.cc

Issue 1273353003: [simd.js] Single SIMD128_VALUE_TYPE for all Simd128Values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix slow check failures. REBASE. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 3414 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(v0, if_false); 3434 __ JumpIfSmi(v0, if_false);
3435 Register map = a1; 3435 __ GetObjectType(v0, a1, a1);
3436 Register type_reg = a2;
3437 __ GetObjectType(v0, map, type_reg);
3438 __ Subu(type_reg, type_reg, Operand(FIRST_SIMD_VALUE_TYPE));
3439 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 3436 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3440 Split(ls, type_reg, Operand(LAST_SIMD_VALUE_TYPE - FIRST_SIMD_VALUE_TYPE), 3437 Split(eq, a1, Operand(SIMD128_VALUE_TYPE), if_true, if_false, fall_through);
3441 if_true, if_false, fall_through);
3442 3438
3443 context()->Plug(if_true, if_false); 3439 context()->Plug(if_true, if_false);
3444 } 3440 }
3445 3441
3446 3442
3447 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { 3443 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) {
3448 ZoneList<Expression*>* args = expr->arguments(); 3444 ZoneList<Expression*>* args = expr->arguments();
3449 DCHECK(args->length() == 1); 3445 DCHECK(args->length() == 1);
3450 3446
3451 VisitForAccumulatorValue(args->at(0)); 3447 VisitForAccumulatorValue(args->at(0));
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
5065 __ GetObjectType(v0, v0, a1); 5061 __ GetObjectType(v0, v0, a1);
5066 __ Branch(if_false, ge, a1, Operand(FIRST_NONSTRING_TYPE)); 5062 __ Branch(if_false, ge, a1, Operand(FIRST_NONSTRING_TYPE));
5067 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 5063 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
5068 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); 5064 __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
5069 Split(eq, a1, Operand(zero_reg), 5065 Split(eq, a1, Operand(zero_reg),
5070 if_true, if_false, fall_through); 5066 if_true, if_false, fall_through);
5071 } else if (String::Equals(check, factory->symbol_string())) { 5067 } else if (String::Equals(check, factory->symbol_string())) {
5072 __ JumpIfSmi(v0, if_false); 5068 __ JumpIfSmi(v0, if_false);
5073 __ GetObjectType(v0, v0, a1); 5069 __ GetObjectType(v0, v0, a1);
5074 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through); 5070 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through);
5075 } else if (String::Equals(check, factory->float32x4_string())) {
5076 __ JumpIfSmi(v0, if_false);
5077 __ GetObjectType(v0, v0, a1);
5078 Split(eq, a1, Operand(FLOAT32X4_TYPE), if_true, if_false, fall_through);
5079 } else if (String::Equals(check, factory->int32x4_string())) {
5080 __ JumpIfSmi(v0, if_false);
5081 __ GetObjectType(v0, v0, a1);
5082 Split(eq, a1, Operand(INT32X4_TYPE), if_true, if_false, fall_through);
5083 } else if (String::Equals(check, factory->bool32x4_string())) {
5084 __ JumpIfSmi(v0, if_false);
5085 __ GetObjectType(v0, v0, a1);
5086 Split(eq, a1, Operand(BOOL32X4_TYPE), if_true, if_false, fall_through);
5087 } else if (String::Equals(check, factory->int16x8_string())) {
5088 __ JumpIfSmi(v0, if_false);
5089 __ GetObjectType(v0, v0, a1);
5090 Split(eq, a1, Operand(INT16X8_TYPE), if_true, if_false, fall_through);
5091 } else if (String::Equals(check, factory->bool16x8_string())) {
5092 __ JumpIfSmi(v0, if_false);
5093 __ GetObjectType(v0, v0, a1);
5094 Split(eq, a1, Operand(BOOL16X8_TYPE), if_true, if_false, fall_through);
5095 } else if (String::Equals(check, factory->int8x16_string())) {
5096 __ JumpIfSmi(v0, if_false);
5097 __ GetObjectType(v0, v0, a1);
5098 Split(eq, a1, Operand(INT8X16_TYPE), if_true, if_false, fall_through);
5099 } else if (String::Equals(check, factory->bool8x16_string())) {
5100 __ JumpIfSmi(v0, if_false);
5101 __ GetObjectType(v0, v0, a1);
5102 Split(eq, a1, Operand(BOOL8X16_TYPE), if_true, if_false, fall_through);
5103 } else if (String::Equals(check, factory->boolean_string())) { 5071 } else if (String::Equals(check, factory->boolean_string())) {
5104 __ LoadRoot(at, Heap::kTrueValueRootIndex); 5072 __ LoadRoot(at, Heap::kTrueValueRootIndex);
5105 __ Branch(if_true, eq, v0, Operand(at)); 5073 __ Branch(if_true, eq, v0, Operand(at));
5106 __ LoadRoot(at, Heap::kFalseValueRootIndex); 5074 __ LoadRoot(at, Heap::kFalseValueRootIndex);
5107 Split(eq, v0, Operand(at), if_true, if_false, fall_through); 5075 Split(eq, v0, Operand(at), if_true, if_false, fall_through);
5108 } else if (String::Equals(check, factory->undefined_string())) { 5076 } else if (String::Equals(check, factory->undefined_string())) {
5109 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 5077 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
5110 __ Branch(if_true, eq, v0, Operand(at)); 5078 __ Branch(if_true, eq, v0, Operand(at));
5111 __ JumpIfSmi(v0, if_false); 5079 __ JumpIfSmi(v0, if_false);
5112 // Check for undetectable objects => true. 5080 // Check for undetectable objects => true.
(...skipping 14 matching lines...) Expand all
5127 __ Branch(if_true, eq, v0, Operand(at)); 5095 __ Branch(if_true, eq, v0, Operand(at));
5128 // Check for JS objects => true. 5096 // Check for JS objects => true.
5129 __ GetObjectType(v0, v0, a1); 5097 __ GetObjectType(v0, v0, a1);
5130 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 5098 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
5131 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset)); 5099 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset));
5132 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); 5100 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE));
5133 // Check for undetectable objects => false. 5101 // Check for undetectable objects => false.
5134 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 5102 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
5135 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); 5103 __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
5136 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through); 5104 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through);
5105 // clang-format off
5106 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
5107 } else if (String::Equals(check, factory->type##_string())) { \
5108 __ JumpIfSmi(v0, if_false); \
5109 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); \
5110 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \
5111 Split(eq, v0, Operand(at), if_true, if_false, fall_through);
5112 SIMD128_TYPES(SIMD128_TYPE)
5113 #undef SIMD128_TYPE
5114 // clang-format on
5137 } else { 5115 } else {
5138 if (if_false != fall_through) __ jmp(if_false); 5116 if (if_false != fall_through) __ jmp(if_false);
5139 } 5117 }
5140 context()->Plug(if_true, if_false); 5118 context()->Plug(if_true, if_false);
5141 } 5119 }
5142 5120
5143 5121
5144 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { 5122 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
5145 Comment cmnt(masm_, "[ CompareOperation"); 5123 Comment cmnt(masm_, "[ CompareOperation");
5146 SetExpressionPosition(expr); 5124 SetExpressionPosition(expr);
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
5428 reinterpret_cast<uint32_t>( 5406 reinterpret_cast<uint32_t>(
5429 isolate->builtins()->OsrAfterStackCheck()->entry())); 5407 isolate->builtins()->OsrAfterStackCheck()->entry()));
5430 return OSR_AFTER_STACK_CHECK; 5408 return OSR_AFTER_STACK_CHECK;
5431 } 5409 }
5432 5410
5433 5411
5434 } // namespace internal 5412 } // namespace internal
5435 } // namespace v8 5413 } // namespace v8
5436 5414
5437 #endif // V8_TARGET_ARCH_MIPS 5415 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698