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

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

Issue 283833005: Fix bug on arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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/assembler_arm64_test.cc ('k') | tools/testing/dart/runtime_configuration.dart » ('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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 __ cset(result, true_condition); 164 __ cset(result, true_condition);
165 165
166 if (is_power_of_two_kind) { 166 if (is_power_of_two_kind) {
167 const intptr_t shift = 167 const intptr_t shift =
168 Utils::ShiftForPowerOfTwo(Utils::Maximum(true_value, false_value)); 168 Utils::ShiftForPowerOfTwo(Utils::Maximum(true_value, false_value));
169 __ Lsl(result, result, shift + kSmiTagSize); 169 __ Lsl(result, result, shift + kSmiTagSize);
170 } else { 170 } else {
171 __ sub(result, result, Operand(1)); 171 __ sub(result, result, Operand(1));
172 const int32_t val = 172 const int64_t val =
173 Smi::RawValue(true_value) - Smi::RawValue(false_value); 173 Smi::RawValue(true_value) - Smi::RawValue(false_value);
174 __ AndImmediate(result, result, val, PP); 174 __ AndImmediate(result, result, val, PP);
175 if (false_value != 0) { 175 if (false_value != 0) {
176 __ AddImmediate(result, result, Smi::RawValue(false_value), PP); 176 __ AddImmediate(result, result, Smi::RawValue(false_value), PP);
177 } 177 }
178 } 178 }
179 } 179 }
180 180
181 181
182 LocationSummary* ClosureCallInstr::MakeLocationSummary(bool opt) const { 182 LocationSummary* ClosureCallInstr::MakeLocationSummary(bool opt) const {
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 return locs; 540 return locs;
541 } 541 }
542 542
543 543
544 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, 544 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
545 BranchLabels labels) { 545 BranchLabels labels) {
546 Register left = locs()->in(0).reg(); 546 Register left = locs()->in(0).reg();
547 Location right = locs()->in(1); 547 Location right = locs()->in(1);
548 if (right.IsConstant()) { 548 if (right.IsConstant()) {
549 ASSERT(right.constant().IsSmi()); 549 ASSERT(right.constant().IsSmi());
550 const int32_t imm = 550 const int64_t imm =
551 reinterpret_cast<int64_t>(right.constant().raw()); 551 reinterpret_cast<int64_t>(right.constant().raw());
552 __ TestImmediate(left, imm, PP); 552 __ TestImmediate(left, imm, PP);
553 } else { 553 } else {
554 __ tst(left, Operand(right.reg())); 554 __ tst(left, Operand(right.reg()));
555 } 555 }
556 Condition true_condition = (kind() == Token::kNE) ? NE : EQ; 556 Condition true_condition = (kind() == Token::kNE) ? NE : EQ;
557 return true_condition; 557 return true_condition;
558 } 558 }
559 559
560 560
(...skipping 3872 matching lines...) Expand 10 before | Expand all | Expand 10 after
4433 compiler->GenerateCall(token_pos(), 4433 compiler->GenerateCall(token_pos(),
4434 &label, 4434 &label,
4435 PcDescriptors::kOther, 4435 PcDescriptors::kOther,
4436 locs()); 4436 locs());
4437 __ Drop(ArgumentCount()); // Discard arguments. 4437 __ Drop(ArgumentCount()); // Discard arguments.
4438 } 4438 }
4439 4439
4440 } // namespace dart 4440 } // namespace dart
4441 4441
4442 #endif // defined TARGET_ARCH_ARM64 4442 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64_test.cc ('k') | tools/testing/dart/runtime_configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698