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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 22853009: For trigonometric functions call to C-libraries: they are faster than x87 operations (3% on Box2D). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 27253)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -2641,6 +2641,27 @@
}
+extern const RuntimeEntry kCosRuntimeEntry(
+ "libc_cos", reinterpret_cast<RuntimeFunction>(
+ static_cast<UnaryMathCFunction>(&cos)), 1, true, true);
+
+extern const RuntimeEntry kSinRuntimeEntry(
+ "libc_sin", reinterpret_cast<RuntimeFunction>(
+ static_cast<UnaryMathCFunction>(&sin)), 1, true, true);
+
+
+const RuntimeEntry& MathUnaryInstr::TargetFunction() const {
+ switch (kind()) {
+ case MethodRecognizer::kMathSin:
+ return kSinRuntimeEntry;
+ case MethodRecognizer::kMathCos:
+ return kCosRuntimeEntry;
+ default:
+ UNREACHABLE();
+ }
+ return kSinRuntimeEntry;
+}
+
#undef __
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698