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

Side by Side Diff: src/ia32/lithium-gap-resolver-ia32.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/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/ia32/lithium-codegen-ia32.h" 9 #include "src/ia32/lithium-codegen-ia32.h"
10 #include "src/ia32/lithium-gap-resolver-ia32.h" 10 #include "src/ia32/lithium-gap-resolver-ia32.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 Register dst = cgen_->ToRegister(destination); 285 Register dst = cgen_->ToRegister(destination);
286 Representation r = cgen_->IsSmi(constant_source) 286 Representation r = cgen_->IsSmi(constant_source)
287 ? Representation::Smi() : Representation::Integer32(); 287 ? Representation::Smi() : Representation::Integer32();
288 if (cgen_->IsInteger32(constant_source)) { 288 if (cgen_->IsInteger32(constant_source)) {
289 __ Move(dst, cgen_->ToImmediate(constant_source, r)); 289 __ Move(dst, cgen_->ToImmediate(constant_source, r));
290 } else { 290 } else {
291 __ LoadObject(dst, cgen_->ToHandle(constant_source)); 291 __ LoadObject(dst, cgen_->ToHandle(constant_source));
292 } 292 }
293 } else if (destination->IsDoubleRegister()) { 293 } else if (destination->IsDoubleRegister()) {
294 double v = cgen_->ToDouble(constant_source); 294 double v = cgen_->ToDouble(constant_source);
295 uint64_t int_val = BitCast<uint64_t, double>(v); 295 uint64_t int_val = bit_cast<uint64_t, double>(v);
296 int32_t lower = static_cast<int32_t>(int_val); 296 int32_t lower = static_cast<int32_t>(int_val);
297 int32_t upper = static_cast<int32_t>(int_val >> kBitsPerInt); 297 int32_t upper = static_cast<int32_t>(int_val >> kBitsPerInt);
298 XMMRegister dst = cgen_->ToDoubleRegister(destination); 298 XMMRegister dst = cgen_->ToDoubleRegister(destination);
299 if (int_val == 0) { 299 if (int_val == 0) {
300 __ xorps(dst, dst); 300 __ xorps(dst, dst);
301 } else { 301 } else {
302 __ push(Immediate(upper)); 302 __ push(Immediate(upper));
303 __ push(Immediate(lower)); 303 __ push(Immediate(lower));
304 __ movsd(dst, Operand(esp, 0)); 304 __ movsd(dst, Operand(esp, 0));
305 __ add(esp, Immediate(kDoubleSize)); 305 __ add(esp, Immediate(kDoubleSize));
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 } else if (destination->IsRegister()) { 473 } else if (destination->IsRegister()) {
474 source_uses_[destination->index()] = CountSourceUses(destination); 474 source_uses_[destination->index()] = CountSourceUses(destination);
475 } 475 }
476 } 476 }
477 477
478 #undef __ 478 #undef __
479 479
480 } } // namespace v8::internal 480 } } // namespace v8::internal
481 481
482 #endif // V8_TARGET_ARCH_IA32 482 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698