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

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

Issue 11270013: Fix deoptimzation bug in hoisting smi operation out of loops. (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
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 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 } 1582 }
1583 } 1583 }
1584 1584
1585 1585
1586 void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1586 void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1587 Register left = locs()->in(0).reg(); 1587 Register left = locs()->in(0).reg();
1588 Register result = locs()->out().reg(); 1588 Register result = locs()->out().reg();
1589 ASSERT(left == result); 1589 ASSERT(left == result);
1590 Label* deopt = NULL; 1590 Label* deopt = NULL;
1591 if (CanDeoptimize()) { 1591 if (CanDeoptimize()) {
1592 deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), 1592 deopt = compiler->AddDeoptStub(deopt_id(),
1593 kDeoptBinarySmiOp); 1593 kDeoptBinarySmiOp);
1594 } 1594 }
1595 1595
1596 if (locs()->in(1).IsConstant()) { 1596 if (locs()->in(1).IsConstant()) {
1597 const Object& constant = locs()->in(1).constant(); 1597 const Object& constant = locs()->in(1).constant();
1598 ASSERT(constant.IsSmi()); 1598 ASSERT(constant.IsSmi());
1599 const int32_t imm = 1599 const int32_t imm =
1600 reinterpret_cast<int32_t>(constant.raw()); 1600 reinterpret_cast<int32_t>(constant.raw());
1601 switch (op_kind()) { 1601 switch (op_kind()) {
1602 case Token::kADD: 1602 case Token::kADD:
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 __ jmp(&done); 1755 __ jmp(&done);
1756 { 1756 {
1757 __ Bind(&call_method); 1757 __ Bind(&call_method);
1758 Function& target = Function::ZoneHandle( 1758 Function& target = Function::ZoneHandle(
1759 ic_data()->GetTargetForReceiverClassId(kSmiCid)); 1759 ic_data()->GetTargetForReceiverClassId(kSmiCid));
1760 ASSERT(!target.IsNull()); 1760 ASSERT(!target.IsNull());
1761 const intptr_t kArgumentCount = 2; 1761 const intptr_t kArgumentCount = 2;
1762 __ pushl(temp); 1762 __ pushl(temp);
1763 __ pushl(right); 1763 __ pushl(right);
1764 compiler->GenerateStaticCall( 1764 compiler->GenerateStaticCall(
1765 instance_call()->deopt_id(), 1765 instance_call()->deopt_id(),
Vyacheslav Egorov (Google) 2012/10/24 14:53:00 This place should be also adjusted accordingly. An
Florian Schneider 2012/10/24 18:00:22 Done.
1766 instance_call()->token_pos(), 1766 instance_call()->token_pos(),
1767 target, 1767 target,
1768 kArgumentCount, 1768 kArgumentCount,
1769 Array::Handle(), // No argument names. 1769 Array::Handle(), // No argument names.
1770 locs()); 1770 locs());
1771 ASSERT(result == EAX); 1771 ASSERT(result == EAX);
1772 } 1772 }
1773 __ Bind(&done); 1773 __ Bind(&done);
1774 break; 1774 break;
1775 } 1775 }
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
2583 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. 2583 __ pcmpeqq(XMM0, XMM0); // Generate all 1's.
2584 __ pxor(value, XMM0); 2584 __ pxor(value, XMM0);
2585 } 2585 }
2586 2586
2587 2587
2588 } // namespace dart 2588 } // namespace dart
2589 2589
2590 #undef __ 2590 #undef __
2591 2591
2592 #endif // defined TARGET_ARCH_X64 2592 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698