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

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

Issue 2974633003: Option to truncate integers to 64 bits, part 1 (core VM changes) (Closed)
Patch Set: Merged 2 flags into 1 (--limit-ints-to-64-bits) 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_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 "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 6054 matching lines...) Expand 10 before | Expand all | Expand 10 after
6065 6065
6066 Label* deopt = NULL; 6066 Label* deopt = NULL;
6067 if (CanDeoptimize()) { 6067 if (CanDeoptimize()) {
6068 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp); 6068 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp);
6069 } 6069 }
6070 if (locs()->in(1).IsConstant()) { 6070 if (locs()->in(1).IsConstant()) {
6071 // Code for a constant shift amount. 6071 // Code for a constant shift amount.
6072 ASSERT(locs()->in(1).constant().IsSmi()); 6072 ASSERT(locs()->in(1).constant().IsSmi());
6073 const int64_t shift = 6073 const int64_t shift =
6074 reinterpret_cast<int64_t>(locs()->in(1).constant().raw()) >> 1; 6074 reinterpret_cast<int64_t>(locs()->in(1).constant().raw()) >> 1;
6075 ASSERT(!has_shift_count_check());
6076 ASSERT((0 <= shift) && (shift < 64));
6075 switch (op_kind()) { 6077 switch (op_kind()) {
6076 case Token::kSHR: 6078 case Token::kSHR:
6077 __ sarq(left, Immediate(shift)); 6079 __ sarq(left, Immediate(shift));
6078 break; 6080 break;
6079 case Token::kSHL: { 6081 case Token::kSHL: {
6080 if (can_overflow()) { 6082 if (can_overflow()) {
6081 // Check for overflow. 6083 // Check for overflow.
6082 Register temp = locs()->temp(0).reg(); 6084 Register temp = locs()->temp(0).reg();
6083 __ movq(temp, left); 6085 __ movq(temp, left);
6084 __ shlq(left, Immediate(shift)); 6086 __ shlq(left, Immediate(shift));
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
6646 compiler->AddCurrentDescriptor(stub_kind_, deopt_id_, token_pos()); 6648 compiler->AddCurrentDescriptor(stub_kind_, deopt_id_, token_pos());
6647 compiler->RecordSafepoint(locs()); 6649 compiler->RecordSafepoint(locs());
6648 } 6650 }
6649 6651
6650 6652
6651 } // namespace dart 6653 } // namespace dart
6652 6654
6653 #undef __ 6655 #undef __
6654 6656
6655 #endif // defined TARGET_ARCH_X64 6657 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698