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

Side by Side Diff: runtime/vm/intermediate_language_ia32.cc

Issue 11267043: Small IL cleanup. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after
1985 case Token::kBIT_NOT: 1985 case Token::kBIT_NOT:
1986 __ notl(value); 1986 __ notl(value);
1987 __ andl(value, Immediate(~kSmiTagMask)); // Remove inverted smi-tag. 1987 __ andl(value, Immediate(~kSmiTagMask)); // Remove inverted smi-tag.
1988 break; 1988 break;
1989 default: 1989 default:
1990 UNREACHABLE(); 1990 UNREACHABLE();
1991 } 1991 }
1992 } 1992 }
1993 1993
1994 1994
1995 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const {
1996 const intptr_t kNumInputs = 1;
1997 const intptr_t kNumTemps = 1;
1998 LocationSummary* locs =
1999 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
2000 locs->set_in(0, Location::RequiresRegister());
2001 locs->set_temp(0, Location::RequiresRegister());
2002 locs->set_out(Location::SameAsFirstInput());
2003 return locs;
2004 }
2005
2006
2007 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2008 Register value = locs()->in(0).reg();
2009 Register result = locs()->out().reg();
2010
2011 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
2012 kDeoptDoubleToDouble);
2013 Register temp = locs()->temp(0).reg();
2014 __ testl(value, Immediate(kSmiTagMask));
2015 __ j(ZERO, deopt); // Deoptimize if Smi.
2016 __ CompareClassId(value, kDoubleCid, temp);
2017 __ j(NOT_EQUAL, deopt); // Deoptimize if not Double.
2018 ASSERT(value == result);
2019 }
2020
2021
2022 LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const { 1995 LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const {
2023 return MakeCallSummary(); // Calls a stub to allocate result. 1996 return MakeCallSummary(); // Calls a stub to allocate result.
2024 } 1997 }
2025 1998
2026 1999
2027 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2000 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2028 Register result = locs()->out().reg(); 2001 Register result = locs()->out().reg();
2029 2002
2030 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), 2003 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
2031 kDeoptIntegerToDouble); 2004 kDeoptIntegerToDouble);
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
2583 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. 2556 __ pcmpeqq(XMM0, XMM0); // Generate all 1's.
2584 __ pxor(value, XMM0); 2557 __ pxor(value, XMM0);
2585 } 2558 }
2586 2559
2587 2560
2588 } // namespace dart 2561 } // namespace dart
2589 2562
2590 #undef __ 2563 #undef __
2591 2564
2592 #endif // defined TARGET_ARCH_X64 2565 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698