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

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

Issue 2975073002: Replace manual untagging of smi with proper Smi methods (Closed)
Patch Set: Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 6065 matching lines...) Expand 10 before | Expand all | Expand 10 after
6076 ASSERT(out_lo == left_lo); 6076 ASSERT(out_lo == left_lo);
6077 ASSERT(out_hi == left_hi); 6077 ASSERT(out_hi == left_hi);
6078 6078
6079 Label* deopt = NULL; 6079 Label* deopt = NULL;
6080 if (CanDeoptimize()) { 6080 if (CanDeoptimize()) {
6081 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp); 6081 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp);
6082 } 6082 }
6083 if (locs()->in(1).IsConstant()) { 6083 if (locs()->in(1).IsConstant()) {
6084 // Code for a constant shift amount. 6084 // Code for a constant shift amount.
6085 ASSERT(locs()->in(1).constant().IsSmi()); 6085 ASSERT(locs()->in(1).constant().IsSmi());
6086 const int32_t shift = 6086 const int32_t shift = Smi::Cast(locs()->in(1).constant()).Value();
6087 reinterpret_cast<int32_t>(locs()->in(1).constant().raw()) >> 1;
6088 ASSERT(shift >= 0); 6087 ASSERT(shift >= 0);
6089 switch (op_kind()) { 6088 switch (op_kind()) {
6090 case Token::kSHR: { 6089 case Token::kSHR: {
6091 if (shift > 31) { 6090 if (shift > 31) {
6092 __ movl(left_lo, left_hi); // Shift by 32. 6091 __ movl(left_lo, left_hi); // Shift by 32.
6093 __ sarl(left_hi, Immediate(31)); // Sign extend left hi. 6092 __ sarl(left_hi, Immediate(31)); // Sign extend left hi.
6094 if (shift > 32) { 6093 if (shift > 32) {
6095 __ sarl(left_lo, Immediate(shift > 63 ? 31 : shift - 32)); 6094 __ sarl(left_lo, Immediate(shift > 63 ? 31 : shift - 32));
6096 } 6095 }
6097 } else { 6096 } else {
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
6786 __ Call(*StubCode::DebugStepCheck_entry()); 6785 __ Call(*StubCode::DebugStepCheck_entry());
6787 compiler->EmitCallsiteMetaData(token_pos(), deopt_id_, stub_kind_, locs()); 6786 compiler->EmitCallsiteMetaData(token_pos(), deopt_id_, stub_kind_, locs());
6788 } 6787 }
6789 6788
6790 6789
6791 } // namespace dart 6790 } // namespace dart
6792 6791
6793 #undef __ 6792 #undef __
6794 6793
6795 #endif // defined TARGET_ARCH_IA32 6794 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698