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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flow_graph_allocator.h" 10 #include "vm/flow_graph_allocator.h"
(...skipping 2623 matching lines...) Expand 10 before | Expand all | Expand 10 after
2634 return kPowRuntimeEntry; 2634 return kPowRuntimeEntry;
2635 case MethodRecognizer::kDoubleMod: 2635 case MethodRecognizer::kDoubleMod:
2636 return kModRuntimeEntry; 2636 return kModRuntimeEntry;
2637 default: 2637 default:
2638 UNREACHABLE(); 2638 UNREACHABLE();
2639 } 2639 }
2640 return kPowRuntimeEntry; 2640 return kPowRuntimeEntry;
2641 } 2641 }
2642 2642
2643 2643
2644 extern const RuntimeEntry kCosRuntimeEntry(
2645 "libc_cos", reinterpret_cast<RuntimeFunction>(
2646 static_cast<UnaryMathCFunction>(&cos)), 1, true, true);
2647
2648 extern const RuntimeEntry kSinRuntimeEntry(
2649 "libc_sin", reinterpret_cast<RuntimeFunction>(
2650 static_cast<UnaryMathCFunction>(&sin)), 1, true, true);
2651
2652
2653 const RuntimeEntry& MathUnaryInstr::TargetFunction() const {
2654 switch (kind()) {
2655 case MethodRecognizer::kMathSin:
2656 return kSinRuntimeEntry;
2657 case MethodRecognizer::kMathCos:
2658 return kCosRuntimeEntry;
2659 default:
2660 UNREACHABLE();
2661 }
2662 return kSinRuntimeEntry;
2663 }
2664
2644 #undef __ 2665 #undef __
2645 2666
2646 } // namespace dart 2667 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698