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

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

Issue 10542167: Inline Math.sqrt in new compilers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
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 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after
2734 } 2734 }
2735 } 2735 }
2736 return false; 2736 return false;
2737 } 2737 }
2738 2738
2739 2739
2740 // TODO(srdjan): For Math.sqrt read type feedback in Math.sqrt and decide 2740 // TODO(srdjan): For Math.sqrt read type feedback in Math.sqrt and decide
2741 // if the argument is double, smi or something else. 2741 // if the argument is double, smi or something else.
2742 bool OptimizingCodeGenerator::TryInlineStaticCall(StaticCallNode* node) { 2742 bool OptimizingCodeGenerator::TryInlineStaticCall(StaticCallNode* node) {
2743 Recognizer::Kind recognized = Recognizer::RecognizeKind(node->function()); 2743 Recognizer::Kind recognized = Recognizer::RecognizeKind(node->function());
2744 if (false && recognized == Recognizer::kMathSqrt) { 2744 if (recognized == Recognizer::kMathSqrt) {
2745 Label smi_to_double, call_method, done; 2745 Label smi_to_double, call_method, done;
2746 __ movl(EAX, Address(ESP, 0)); 2746 __ movl(EAX, Address(ESP, 0));
2747 CheckIfDoubleOrSmi(EAX, EBX, &smi_to_double, &call_method); 2747 CheckIfDoubleOrSmi(EAX, EBX, &smi_to_double, &call_method);
2748 __ movsd(XMM1, FieldAddress(EAX, Double::value_offset())); 2748 __ movsd(XMM1, FieldAddress(EAX, Double::value_offset()));
2749 __ sqrtsd(XMM0, XMM1); 2749 __ sqrtsd(XMM0, XMM1);
2750 AssemblerMacros::TryAllocate(assembler_, 2750 AssemblerMacros::TryAllocate(assembler_,
2751 double_class_, 2751 double_class_,
2752 &call_method, 2752 &call_method,
2753 EAX); // Result register. 2753 EAX); // Result register.
2754 __ movsd(FieldAddress(EAX, Double::value_offset()), XMM0); 2754 __ movsd(FieldAddress(EAX, Double::value_offset()), XMM0);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 } 2887 }
2888 } 2888 }
2889 // TODO(srdjan): Implement unary kSUB (negate) Mint. 2889 // TODO(srdjan): Implement unary kSUB (negate) Mint.
2890 CodeGenerator::VisitUnaryOpNode(node); 2890 CodeGenerator::VisitUnaryOpNode(node);
2891 } 2891 }
2892 2892
2893 2893
2894 } // namespace dart 2894 } // namespace dart
2895 2895
2896 #endif // defined TARGET_ARCH_IA32 2896 #endif // defined TARGET_ARCH_IA32
OLDNEW
« runtime/vm/intermediate_language.cc ('K') | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698