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

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

Issue 1662153002: VM: Support fast calls to atan and atan2 in optimized code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: cleanup Created 4 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
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')
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/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 4545 matching lines...) Expand 10 before | Expand all | Expand 10 after
4556 call->env(), 4556 call->env(),
4557 call); 4557 call);
4558 AddCheckClass(min_max->right()->definition(), 4558 AddCheckClass(min_max->right()->definition(),
4559 unary_checks, 4559 unary_checks,
4560 call->deopt_id(), 4560 call->deopt_id(),
4561 call->env(), 4561 call->env(),
4562 call); 4562 call);
4563 ReplaceCall(call, min_max); 4563 ReplaceCall(call, min_max);
4564 } 4564 }
4565 } 4565 }
4566 } else if (recognized_kind == MethodRecognizer::kMathDoublePow) { 4566 } else if ((recognized_kind == MethodRecognizer::kMathDoublePow) ||
4567 (recognized_kind == MethodRecognizer::kMathAtan) ||
4568 (recognized_kind == MethodRecognizer::kMathAtan2)) {
4567 if (FLAG_precompilation) { 4569 if (FLAG_precompilation) {
4568 // No UnboxDouble instructons allowed. 4570 // No UnboxDouble instructons allowed.
4569 return; 4571 return;
4570 } 4572 }
4571 // We know that first argument is double, the second is num. 4573 // We know that first argument is double, the second is num.
Vyacheslav Egorov (Google) 2016/02/04 10:30:58 The comment is a bit confusing now because it does
Florian Schneider 2016/02/04 21:41:49 Done.
4572 // InvokeMathCFunctionInstr requires unboxed doubles. UnboxDouble 4574 // InvokeMathCFunctionInstr requires unboxed doubles. UnboxDouble
4573 // instructions contain type checks and conversions to double. 4575 // instructions contain type checks and conversions to double.
4574 ZoneGrowableArray<Value*>* args = 4576 ZoneGrowableArray<Value*>* args =
4575 new(Z) ZoneGrowableArray<Value*>(call->ArgumentCount()); 4577 new(Z) ZoneGrowableArray<Value*>(call->ArgumentCount());
4576 for (intptr_t i = 0; i < call->ArgumentCount(); i++) { 4578 for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
4577 args->Add(new(Z) Value(call->ArgumentAt(i))); 4579 args->Add(new(Z) Value(call->ArgumentAt(i)));
4578 } 4580 }
4579 InvokeMathCFunctionInstr* invoke = 4581 InvokeMathCFunctionInstr* invoke =
4580 new(Z) InvokeMathCFunctionInstr(args, 4582 new(Z) InvokeMathCFunctionInstr(args,
4581 call->deopt_id(), 4583 call->deopt_id(),
(...skipping 4265 matching lines...) Expand 10 before | Expand all | Expand 10 after
8847 8849
8848 // Insert materializations at environment uses. 8850 // Insert materializations at environment uses.
8849 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { 8851 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) {
8850 CreateMaterializationAt( 8852 CreateMaterializationAt(
8851 exits_collector_.exits()[i], alloc, *slots); 8853 exits_collector_.exits()[i], alloc, *slots);
8852 } 8854 }
8853 } 8855 }
8854 8856
8855 8857
8856 } // namespace dart 8858 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698