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

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

Issue 553843002: Replace our home-grown BitCast with bit_cast from Chrome/Google3. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/x87/code-stubs-x87.cc ('k') | src/x87/lithium-gap-resolver-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 } 1901 }
1902 1902
1903 1903
1904 void LCodeGen::DoConstantS(LConstantS* instr) { 1904 void LCodeGen::DoConstantS(LConstantS* instr) {
1905 __ Move(ToRegister(instr->result()), Immediate(instr->value())); 1905 __ Move(ToRegister(instr->result()), Immediate(instr->value()));
1906 } 1906 }
1907 1907
1908 1908
1909 void LCodeGen::DoConstantD(LConstantD* instr) { 1909 void LCodeGen::DoConstantD(LConstantD* instr) {
1910 double v = instr->value(); 1910 double v = instr->value();
1911 uint64_t int_val = BitCast<uint64_t, double>(v); 1911 uint64_t int_val = bit_cast<uint64_t, double>(v);
1912 int32_t lower = static_cast<int32_t>(int_val); 1912 int32_t lower = static_cast<int32_t>(int_val);
1913 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt)); 1913 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt));
1914 DCHECK(instr->result()->IsDoubleRegister()); 1914 DCHECK(instr->result()->IsDoubleRegister());
1915 1915
1916 __ push(Immediate(upper)); 1916 __ push(Immediate(upper));
1917 __ push(Immediate(lower)); 1917 __ push(Immediate(lower));
1918 X87Register reg = ToX87Register(instr->result()); 1918 X87Register reg = ToX87Register(instr->result());
1919 X87Mov(reg, Operand(esp, 0)); 1919 X87Mov(reg, Operand(esp, 0));
1920 __ add(Operand(esp), Immediate(kDoubleSize)); 1920 __ add(Operand(esp), Immediate(kDoubleSize));
1921 } 1921 }
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after
4081 instr->key(), 4081 instr->key(),
4082 instr->hydrogen()->key()->representation(), 4082 instr->hydrogen()->key()->representation(),
4083 FAST_DOUBLE_ELEMENTS, 4083 FAST_DOUBLE_ELEMENTS,
4084 instr->base_offset()); 4084 instr->base_offset());
4085 4085
4086 // Can't use SSE2 in the serializer 4086 // Can't use SSE2 in the serializer
4087 if (instr->hydrogen()->IsConstantHoleStore()) { 4087 if (instr->hydrogen()->IsConstantHoleStore()) {
4088 // This means we should store the (double) hole. No floating point 4088 // This means we should store the (double) hole. No floating point
4089 // registers required. 4089 // registers required.
4090 double nan_double = FixedDoubleArray::hole_nan_as_double(); 4090 double nan_double = FixedDoubleArray::hole_nan_as_double();
4091 uint64_t int_val = BitCast<uint64_t, double>(nan_double); 4091 uint64_t int_val = bit_cast<uint64_t, double>(nan_double);
4092 int32_t lower = static_cast<int32_t>(int_val); 4092 int32_t lower = static_cast<int32_t>(int_val);
4093 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt)); 4093 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt));
4094 4094
4095 __ mov(double_store_operand, Immediate(lower)); 4095 __ mov(double_store_operand, Immediate(lower));
4096 Operand double_store_operand2 = BuildFastArrayOperand( 4096 Operand double_store_operand2 = BuildFastArrayOperand(
4097 instr->elements(), 4097 instr->elements(),
4098 instr->key(), 4098 instr->key(),
4099 instr->hydrogen()->key()->representation(), 4099 instr->hydrogen()->key()->representation(),
4100 FAST_DOUBLE_ELEMENTS, 4100 FAST_DOUBLE_ELEMENTS,
4101 instr->base_offset() + kPointerSize); 4101 instr->base_offset() + kPointerSize);
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
5703 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5703 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5704 RecordSafepoint(Safepoint::kNoLazyDeopt); 5704 RecordSafepoint(Safepoint::kNoLazyDeopt);
5705 } 5705 }
5706 5706
5707 5707
5708 #undef __ 5708 #undef __
5709 5709
5710 } } // namespace v8::internal 5710 } } // namespace v8::internal
5711 5711
5712 #endif // V8_TARGET_ARCH_X87 5712 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/code-stubs-x87.cc ('k') | src/x87/lithium-gap-resolver-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698