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

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

Issue 10632010: Fix excessive deoptimizations in Meteor: kSHL on two Smi-s can easily overflow, which led to deopti… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1752 intptr_t test_class_id; 1752 intptr_t test_class_id;
1753 Function& target = Function::Handle(); 1753 Function& target = Function::Handle();
1754 ic_data.GetOneClassCheckAt(0, &test_class_id, &target); 1754 ic_data.GetOneClassCheckAt(0, &test_class_id, &target);
1755 1755
1756 Register value = locs()->in(0).reg(); 1756 Register value = locs()->in(0).reg();
1757 Register result = locs()->out().reg(); 1757 Register result = locs()->out().reg();
1758 ASSERT(value == result); 1758 ASSERT(value == result);
1759 Label* deopt = compiler->AddDeoptStub(instance_call()->cid(), 1759 Label* deopt = compiler->AddDeoptStub(instance_call()->cid(),
1760 instance_call()->token_index(), 1760 instance_call()->token_index(),
1761 instance_call()->try_index(), 1761 instance_call()->try_index(),
1762 kDeoptSmiBinaryOp, 1762 kDeoptUnaryOp,
1763 value); 1763 value);
1764 if (test_class_id == kSmi) { 1764 if (test_class_id == kSmi) {
1765 __ testq(value, Immediate(kSmiTagMask)); 1765 __ testq(value, Immediate(kSmiTagMask));
1766 __ j(NOT_ZERO, deopt); 1766 __ j(NOT_ZERO, deopt);
1767 switch (op_kind()) { 1767 switch (op_kind()) {
1768 case Token::kNEGATE: 1768 case Token::kNEGATE:
1769 __ negq(value); 1769 __ negq(value);
1770 __ j(OVERFLOW, deopt); 1770 __ j(OVERFLOW, deopt);
1771 break; 1771 break;
1772 case Token::kBIT_NOT: 1772 case Token::kBIT_NOT:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 intptr_t test_class_id; 1805 intptr_t test_class_id;
1806 Function& target = Function::Handle(); 1806 Function& target = Function::Handle();
1807 ic_data.GetOneClassCheckAt(0, &test_class_id, &target); 1807 ic_data.GetOneClassCheckAt(0, &test_class_id, &target);
1808 1808
1809 Register value = locs()->in(0).reg(); 1809 Register value = locs()->in(0).reg();
1810 Register result = locs()->out().reg(); 1810 Register result = locs()->out().reg();
1811 ASSERT(value == result); 1811 ASSERT(value == result);
1812 Label* deopt = compiler->AddDeoptStub(instance_call()->cid(), 1812 Label* deopt = compiler->AddDeoptStub(instance_call()->cid(),
1813 instance_call()->token_index(), 1813 instance_call()->token_index(),
1814 instance_call()->try_index(), 1814 instance_call()->try_index(),
1815 kDeoptSmiBinaryOp, 1815 kDeoptUnaryOp,
1816 value); 1816 value);
1817 if (test_class_id == kDouble) { 1817 if (test_class_id == kDouble) {
1818 Register temp = locs()->temp(0).reg(); 1818 Register temp = locs()->temp(0).reg();
1819 __ testq(value, Immediate(kSmiTagMask)); 1819 __ testq(value, Immediate(kSmiTagMask));
1820 __ j(ZERO, deopt); // Smi. 1820 __ j(ZERO, deopt); // Smi.
1821 __ CompareClassId(value, kDouble); 1821 __ CompareClassId(value, kDouble);
1822 __ j(NOT_EQUAL, deopt); 1822 __ j(NOT_EQUAL, deopt);
1823 // Allocate result object. 1823 // Allocate result object.
1824 const Class& double_class = compiler->double_class(); 1824 const Class& double_class = compiler->double_class();
1825 const Code& stub = 1825 const Code& stub =
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 instance_call()->argument_names()); 1949 instance_call()->argument_names());
1950 } 1950 }
1951 __ Bind(&done); 1951 __ Bind(&done);
1952 } 1952 }
1953 1953
1954 } // namespace dart 1954 } // namespace dart
1955 1955
1956 #undef __ 1956 #undef __
1957 1957
1958 #endif // defined TARGET_ARCH_X64 1958 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698