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

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

Issue 9225008: Fix a perfrormance degradation in Mandelbrot: double comparison may have (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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 | « no previous file | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/opt_code_generator.h" 8 #include "vm/opt_code_generator.h"
9 9
10 #include "vm/assembler_macros.h" 10 #include "vm/assembler_macros.h"
(...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2270 // Return false if the code cannot be generated. 2270 // Return false if the code cannot be generated.
2271 bool OptimizingCodeGenerator::GenerateDoubleComparison(ComparisonNode* node) { 2271 bool OptimizingCodeGenerator::GenerateDoubleComparison(ComparisonNode* node) {
2272 Condition true_condition; 2272 Condition true_condition;
2273 if (!SupportedTokenKindToDoubleCondition(node->kind(), &true_condition)) { 2273 if (!SupportedTokenKindToDoubleCondition(node->kind(), &true_condition)) {
2274 return false; 2274 return false;
2275 } 2275 }
2276 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); 2276 const Bool& bool_true = Bool::ZoneHandle(Bool::True());
2277 const Bool& bool_false = Bool::ZoneHandle(Bool::False()); 2277 const Bool& bool_false = Bool::ZoneHandle(Bool::False());
2278 CodeGenInfo left_info(node->left()); 2278 CodeGenInfo left_info(node->left());
2279 CodeGenInfo right_info(node->right()); 2279 CodeGenInfo right_info(node->right());
2280 left_info.set_allow_temp(true);
2281 right_info.set_allow_temp(true);
2280 VisitLoadTwo(node->left(), node->right(), EAX, EDX); 2282 VisitLoadTwo(node->left(), node->right(), EAX, EDX);
2281 DeoptimizationBlob* deopt_blob = NULL; 2283 DeoptimizationBlob* deopt_blob = NULL;
2282 if (!left_info.IsClass(double_class_) || !right_info.IsClass(double_class_)) { 2284 if (!left_info.IsClass(double_class_) || !right_info.IsClass(double_class_)) {
2283 deopt_blob = AddDeoptimizationBlob(node, EAX, EDX, kDeoptDoubleComparison); 2285 deopt_blob = AddDeoptimizationBlob(node, EAX, EDX, kDeoptDoubleComparison);
2284 } 2286 }
2285 if (!left_info.IsClass(double_class_)) { 2287 if (!left_info.IsClass(double_class_)) {
2286 CheckIfDoubleOrSmi(EAX, EBX, deopt_blob->label(), deopt_blob->label()); 2288 CheckIfDoubleOrSmi(EAX, EBX, deopt_blob->label(), deopt_blob->label());
2287 PropagateBackLocalClass(node->left(), double_class_); 2289 PropagateBackLocalClass(node->left(), double_class_);
2288 } 2290 }
2289 if (!right_info.IsClass(double_class_)) { 2291 if (!right_info.IsClass(double_class_)) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 return; 2365 return;
2364 } 2366 }
2365 2367
2366 if (AtIdNodeHasClassAt(node, node->id(), smi_class_, 0)) { 2368 if (AtIdNodeHasClassAt(node, node->id(), smi_class_, 0)) {
2367 if (GenerateSmiComparison(node)) { 2369 if (GenerateSmiComparison(node)) {
2368 // The comparison was handled, code was emitted. 2370 // The comparison was handled, code was emitted.
2369 return; 2371 return;
2370 } 2372 }
2371 // Fall through if condition is not supported. 2373 // Fall through if condition is not supported.
2372 } else if (AtIdNodeHasClassAt(node, node->id(), double_class_, 0)) { 2374 } else if (AtIdNodeHasClassAt(node, node->id(), double_class_, 0)) {
2373 // Double comparison 2375 // Double comparison.
2374 if (GenerateDoubleComparison(node)) { 2376 if (GenerateDoubleComparison(node)) {
2375 return; 2377 return;
2376 } 2378 }
2377 } else if ((node->kind() == Token::kEQ) || (node->kind() == Token::kNE)) { 2379 } else if ((node->kind() == Token::kEQ) || (node->kind() == Token::kNE)) {
2378 // Equality, not-equality comparison of any other type. 2380 // Equality, not-equality comparison of any other type.
2379 if (GenerateEqualityComparison(node)) { 2381 if (GenerateEqualityComparison(node)) {
2380 return; 2382 return;
2381 } 2383 }
2382 } 2384 }
2383 2385
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
3128 } 3130 }
3129 } 3131 }
3130 // TODO(srdjan): Implement unary kSUB (negate) Mint. 3132 // TODO(srdjan): Implement unary kSUB (negate) Mint.
3131 CodeGenerator::VisitUnaryOpNode(node); 3133 CodeGenerator::VisitUnaryOpNode(node);
3132 } 3134 }
3133 3135
3134 3136
3135 } // namespace dart 3137 } // namespace dart
3136 3138
3137 #endif // defined TARGET_ARCH_IA32 3139 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698