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

Side by Side Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 2695653005: Revert of Remove SIMD.js from V8. (Closed)
Patch Set: Created 3 years, 10 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 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/crankshaft/ppc/lithium-codegen-ppc.h" 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/builtins/builtins-constructor.h" 8 #include "src/builtins/builtins-constructor.h"
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 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2199 __ b(instr->FalseLabel(chunk_)); 2199 __ b(instr->FalseLabel(chunk_));
2200 __ bind(&not_string); 2200 __ bind(&not_string);
2201 } 2201 }
2202 2202
2203 if (expected & ToBooleanHint::kSymbol) { 2203 if (expected & ToBooleanHint::kSymbol) {
2204 // Symbol value -> true. 2204 // Symbol value -> true.
2205 __ CompareInstanceType(map, ip, SYMBOL_TYPE); 2205 __ CompareInstanceType(map, ip, SYMBOL_TYPE);
2206 __ beq(instr->TrueLabel(chunk_)); 2206 __ beq(instr->TrueLabel(chunk_));
2207 } 2207 }
2208 2208
2209 if (expected & ToBooleanHint::kSimdValue) {
2210 // SIMD value -> true.
2211 Label not_simd;
2212 __ CompareInstanceType(map, ip, SIMD128_VALUE_TYPE);
2213 __ beq(instr->TrueLabel(chunk_));
2214 }
2215
2209 if (expected & ToBooleanHint::kHeapNumber) { 2216 if (expected & ToBooleanHint::kHeapNumber) {
2210 // heap number -> false iff +0, -0, or NaN. 2217 // heap number -> false iff +0, -0, or NaN.
2211 Label not_heap_number; 2218 Label not_heap_number;
2212 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); 2219 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex);
2213 __ bne(&not_heap_number); 2220 __ bne(&not_heap_number);
2214 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); 2221 __ lfd(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset));
2215 // Test the double value. Zero and NaN are false. 2222 // Test the double value. Zero and NaN are false.
2216 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7); 2223 __ fcmpu(dbl_scratch, kDoubleRegZero, cr7);
2217 __ mfcr(r0); 2224 __ mfcr(r0);
2218 __ andi(r0, r0, Operand(crZOrNaNBits)); 2225 __ andi(r0, r0, Operand(crZOrNaNBits));
(...skipping 3200 matching lines...) Expand 10 before | Expand all | Expand 10 after
5419 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); 5426 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
5420 __ CompareObjectType(input, scratch, ip, FIRST_JS_RECEIVER_TYPE); 5427 __ CompareObjectType(input, scratch, ip, FIRST_JS_RECEIVER_TYPE);
5421 __ blt(false_label); 5428 __ blt(false_label);
5422 // Check for callable or undetectable objects => false. 5429 // Check for callable or undetectable objects => false.
5423 __ lbz(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); 5430 __ lbz(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
5424 __ andi(r0, scratch, 5431 __ andi(r0, scratch,
5425 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); 5432 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5426 __ cmpi(r0, Operand::Zero()); 5433 __ cmpi(r0, Operand::Zero());
5427 final_branch_condition = eq; 5434 final_branch_condition = eq;
5428 5435
5436 // clang-format off
5437 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
5438 } else if (String::Equals(type_name, factory->type##_string())) { \
5439 __ JumpIfSmi(input, false_label); \
5440 __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \
5441 __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \
5442 final_branch_condition = eq;
5443 SIMD128_TYPES(SIMD128_TYPE)
5444 #undef SIMD128_TYPE
5445 // clang-format on
5446
5429 } else { 5447 } else {
5430 __ b(false_label); 5448 __ b(false_label);
5431 } 5449 }
5432 5450
5433 return final_branch_condition; 5451 return final_branch_condition;
5434 } 5452 }
5435 5453
5436 5454
5437 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { 5455 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
5438 if (info()->ShouldEnsureSpaceForLazyDeopt()) { 5456 if (info()->ShouldEnsureSpaceForLazyDeopt()) {
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
5670 __ LoadP(result, 5688 __ LoadP(result,
5671 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5689 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5672 __ bind(deferred->exit()); 5690 __ bind(deferred->exit());
5673 __ bind(&done); 5691 __ bind(&done);
5674 } 5692 }
5675 5693
5676 #undef __ 5694 #undef __
5677 5695
5678 } // namespace internal 5696 } // namespace internal
5679 } // namespace v8 5697 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/mips64/lithium-codegen-mips64.cc ('k') | src/crankshaft/s390/lithium-codegen-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698