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

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

Issue 15946002: Allow breakpoints on strict equal (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 4140 matching lines...) Expand 10 before | Expand all | Expand 10 after
4151 // TODO(vegorov): should be eliminated earlier by constant propagation. 4151 // TODO(vegorov): should be eliminated earlier by constant propagation.
4152 const bool result = (kind() == Token::kEQ_STRICT) ? 4152 const bool result = (kind() == Token::kEQ_STRICT) ?
4153 left.constant().raw() == right.constant().raw() : 4153 left.constant().raw() == right.constant().raw() :
4154 left.constant().raw() != right.constant().raw(); 4154 left.constant().raw() != right.constant().raw();
4155 __ LoadObject(locs()->out().reg(), result ? Bool::True() : Bool::False()); 4155 __ LoadObject(locs()->out().reg(), result ? Bool::True() : Bool::False());
4156 return; 4156 return;
4157 } 4157 }
4158 if (left.IsConstant()) { 4158 if (left.IsConstant()) {
4159 compiler->EmitEqualityRegConstCompare(right.reg(), 4159 compiler->EmitEqualityRegConstCompare(right.reg(),
4160 left.constant(), 4160 left.constant(),
4161 needs_number_check()); 4161 needs_number_check(),
4162 token_pos());
4162 } else if (right.IsConstant()) { 4163 } else if (right.IsConstant()) {
4163 compiler->EmitEqualityRegConstCompare(left.reg(), 4164 compiler->EmitEqualityRegConstCompare(left.reg(),
4164 right.constant(), 4165 right.constant(),
4165 needs_number_check()); 4166 needs_number_check(),
4167 token_pos());
4166 } else { 4168 } else {
4167 compiler->EmitEqualityRegRegCompare(left.reg(), 4169 compiler->EmitEqualityRegRegCompare(left.reg(),
4168 right.reg(), 4170 right.reg(),
4169 needs_number_check()); 4171 needs_number_check(),
4172 token_pos());
4170 } 4173 }
4171 4174
4172 Register result = locs()->out().reg(); 4175 Register result = locs()->out().reg();
4173 Label load_true, done; 4176 Label load_true, done;
4174 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQUAL : NOT_EQUAL; 4177 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQUAL : NOT_EQUAL;
4175 __ j(true_condition, &load_true, Assembler::kNearJump); 4178 __ j(true_condition, &load_true, Assembler::kNearJump);
4176 __ LoadObject(result, Bool::False()); 4179 __ LoadObject(result, Bool::False());
4177 __ jmp(&done, Assembler::kNearJump); 4180 __ jmp(&done, Assembler::kNearJump);
4178 __ Bind(&load_true); 4181 __ Bind(&load_true);
4179 __ LoadObject(result, Bool::True()); 4182 __ LoadObject(result, Bool::True());
(...skipping 10 matching lines...) Expand all
4190 // TODO(vegorov): should be eliminated earlier by constant propagation. 4193 // TODO(vegorov): should be eliminated earlier by constant propagation.
4191 const bool result = (kind() == Token::kEQ_STRICT) ? 4194 const bool result = (kind() == Token::kEQ_STRICT) ?
4192 left.constant().raw() == right.constant().raw() : 4195 left.constant().raw() == right.constant().raw() :
4193 left.constant().raw() != right.constant().raw(); 4196 left.constant().raw() != right.constant().raw();
4194 branch->EmitBranchOnValue(compiler, result); 4197 branch->EmitBranchOnValue(compiler, result);
4195 return; 4198 return;
4196 } 4199 }
4197 if (left.IsConstant()) { 4200 if (left.IsConstant()) {
4198 compiler->EmitEqualityRegConstCompare(right.reg(), 4201 compiler->EmitEqualityRegConstCompare(right.reg(),
4199 left.constant(), 4202 left.constant(),
4200 needs_number_check()); 4203 needs_number_check(),
4204 token_pos());
4201 } else if (right.IsConstant()) { 4205 } else if (right.IsConstant()) {
4202 compiler->EmitEqualityRegConstCompare(left.reg(), 4206 compiler->EmitEqualityRegConstCompare(left.reg(),
4203 right.constant(), 4207 right.constant(),
4204 needs_number_check()); 4208 needs_number_check(),
4209 token_pos());
4205 } else { 4210 } else {
4206 compiler->EmitEqualityRegRegCompare(left.reg(), 4211 compiler->EmitEqualityRegRegCompare(left.reg(),
4207 right.reg(), 4212 right.reg(),
4208 needs_number_check()); 4213 needs_number_check(),
4214 token_pos());
4209 } 4215 }
4210 4216
4211 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQUAL : NOT_EQUAL; 4217 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQUAL : NOT_EQUAL;
4212 branch->EmitBranchOnCondition(compiler, true_condition); 4218 branch->EmitBranchOnCondition(compiler, true_condition);
4213 } 4219 }
4214 4220
4215 4221
4216 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4222 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4217 // The arguments to the stub include the closure, as does the arguments 4223 // The arguments to the stub include the closure, as does the arguments
4218 // descriptor. 4224 // descriptor.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
4329 PcDescriptors::kOther, 4335 PcDescriptors::kOther,
4330 locs()); 4336 locs());
4331 __ Drop(2); // Discard type arguments and receiver. 4337 __ Drop(2); // Discard type arguments and receiver.
4332 } 4338 }
4333 4339
4334 } // namespace dart 4340 } // namespace dart
4335 4341
4336 #undef __ 4342 #undef __
4337 4343
4338 #endif // defined TARGET_ARCH_X64 4344 #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