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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 1219943002: Expose SIMD.Float32x4 type to Javascript. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't install SIMD object without the simd flag. Created 5 years, 5 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 #include "src/arm/lithium-codegen-arm.h" 7 #include "src/arm/lithium-codegen-arm.h"
8 #include "src/arm/lithium-gap-resolver-arm.h" 8 #include "src/arm/lithium-gap-resolver-arm.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after
2260 __ b(instr->FalseLabel(chunk_)); 2260 __ b(instr->FalseLabel(chunk_));
2261 __ bind(&not_string); 2261 __ bind(&not_string);
2262 } 2262 }
2263 2263
2264 if (expected.Contains(ToBooleanStub::SYMBOL)) { 2264 if (expected.Contains(ToBooleanStub::SYMBOL)) {
2265 // Symbol value -> true. 2265 // Symbol value -> true.
2266 __ CompareInstanceType(map, ip, SYMBOL_TYPE); 2266 __ CompareInstanceType(map, ip, SYMBOL_TYPE);
2267 __ b(eq, instr->TrueLabel(chunk_)); 2267 __ b(eq, instr->TrueLabel(chunk_));
2268 } 2268 }
2269 2269
2270 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) {
2271 // SIMD value -> true.
2272 __ CompareInstanceType(map, ip, FLOAT32X4_TYPE);
2273 __ b(eq, instr->TrueLabel(chunk_));
2274 }
2275
2270 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { 2276 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) {
2271 // heap number -> false iff +0, -0, or NaN. 2277 // heap number -> false iff +0, -0, or NaN.
2272 DwVfpRegister dbl_scratch = double_scratch0(); 2278 DwVfpRegister dbl_scratch = double_scratch0();
2273 Label not_heap_number; 2279 Label not_heap_number;
2274 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); 2280 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex);
2275 __ b(ne, &not_heap_number); 2281 __ b(ne, &not_heap_number);
2276 __ vldr(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); 2282 __ vldr(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset));
2277 __ VFPCompareAndSetFlags(dbl_scratch, 0.0); 2283 __ VFPCompareAndSetFlags(dbl_scratch, 0.0);
2278 __ cmp(r0, r0, vs); // NaN -> false. 2284 __ cmp(r0, r0, vs); // NaN -> false.
2279 __ b(eq, instr->FalseLabel(chunk_)); // +0, -0 -> false. 2285 __ b(eq, instr->FalseLabel(chunk_)); // +0, -0 -> false.
(...skipping 3393 matching lines...) Expand 10 before | Expand all | Expand 10 after
5673 __ CheckObjectTypeRange(input, 5679 __ CheckObjectTypeRange(input,
5674 map, 5680 map,
5675 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, 5681 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE,
5676 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, 5682 LAST_NONCALLABLE_SPEC_OBJECT_TYPE,
5677 false_label); 5683 false_label);
5678 // Check for undetectable objects => false. 5684 // Check for undetectable objects => false.
5679 __ ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); 5685 __ ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset));
5680 __ tst(scratch, Operand(1 << Map::kIsUndetectable)); 5686 __ tst(scratch, Operand(1 << Map::kIsUndetectable));
5681 final_branch_condition = eq; 5687 final_branch_condition = eq;
5682 5688
5689 } else if (String::Equals(type_name, factory->float32x4_string())) {
5690 __ JumpIfSmi(input, false_label);
5691 __ CompareObjectType(input, scratch, no_reg, FLOAT32X4_TYPE);
5692 final_branch_condition = eq;
5693
5683 } else { 5694 } else {
5684 __ b(false_label); 5695 __ b(false_label);
5685 } 5696 }
5686 5697
5687 return final_branch_condition; 5698 return final_branch_condition;
5688 } 5699 }
5689 5700
5690 5701
5691 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { 5702 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
5692 Register temp1 = ToRegister(instr->temp()); 5703 Register temp1 = ToRegister(instr->temp());
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
5989 __ push(ToRegister(instr->function())); 6000 __ push(ToRegister(instr->function()));
5990 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6001 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5991 RecordSafepoint(Safepoint::kNoLazyDeopt); 6002 RecordSafepoint(Safepoint::kNoLazyDeopt);
5992 } 6003 }
5993 6004
5994 6005
5995 #undef __ 6006 #undef __
5996 6007
5997 } // namespace internal 6008 } // namespace internal
5998 } // namespace v8 6009 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698