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

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

Issue 798643003: Pass condition result explicitly. Do not imply the existence of a status (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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_mips.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) 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/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 6227 matching lines...) Expand 10 before | Expand all | Expand 10 after
6238 locs->set_out(0, Location::RequiresRegister()); 6238 locs->set_out(0, Location::RequiresRegister());
6239 return locs; 6239 return locs;
6240 } 6240 }
6241 6241
6242 6242
6243 Condition StrictCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler, 6243 Condition StrictCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
6244 BranchLabels labels) { 6244 BranchLabels labels) {
6245 Location left = locs()->in(0); 6245 Location left = locs()->in(0);
6246 Location right = locs()->in(1); 6246 Location right = locs()->in(1);
6247 ASSERT(!left.IsConstant() || !right.IsConstant()); 6247 ASSERT(!left.IsConstant() || !right.IsConstant());
6248 Condition true_condition;
6248 if (left.IsConstant()) { 6249 if (left.IsConstant()) {
6249 compiler->EmitEqualityRegConstCompare(right.reg(), 6250 true_condition = compiler->EmitEqualityRegConstCompare(right.reg(),
6250 left.constant(), 6251 left.constant(),
6251 needs_number_check(), 6252 needs_number_check(),
6252 token_pos()); 6253 token_pos());
6253 } else if (right.IsConstant()) { 6254 } else if (right.IsConstant()) {
6254 compiler->EmitEqualityRegConstCompare(left.reg(), 6255 true_condition = compiler->EmitEqualityRegConstCompare(left.reg(),
6255 right.constant(), 6256 right.constant(),
6256 needs_number_check(), 6257 needs_number_check(),
6257 token_pos()); 6258 token_pos());
6258 } else { 6259 } else {
6259 compiler->EmitEqualityRegRegCompare(left.reg(), 6260 true_condition = compiler->EmitEqualityRegRegCompare(left.reg(),
6260 right.reg(), 6261 right.reg(),
6261 needs_number_check(), 6262 needs_number_check(),
6262 token_pos()); 6263 token_pos());
6263 } 6264 }
6264 6265 if (kind() != Token::kEQ_STRICT) {
6265 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQUAL : NOT_EQUAL; 6266 ASSERT(kind() == Token::kNE_STRICT);
6267 true_condition = NegateCondition(true_condition);
6268 }
6266 return true_condition; 6269 return true_condition;
6267 } 6270 }
6268 6271
6269 6272
6270 void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6273 void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
6271 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); 6274 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
6272 6275
6273 Label is_true, is_false; 6276 Label is_true, is_false;
6274 BranchLabels labels = { &is_true, &is_false, &is_false }; 6277 BranchLabels labels = { &is_true, &is_false, &is_false };
6275 6278
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
6399 __ movq(R10, Immediate(kInvalidObjectPointer)); 6402 __ movq(R10, Immediate(kInvalidObjectPointer));
6400 __ movq(RBX, Immediate(kInvalidObjectPointer)); 6403 __ movq(RBX, Immediate(kInvalidObjectPointer));
6401 #endif 6404 #endif
6402 } 6405 }
6403 6406
6404 } // namespace dart 6407 } // namespace dart
6405 6408
6406 #undef __ 6409 #undef __
6407 6410
6408 #endif // defined TARGET_ARCH_X64 6411 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698