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

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

Issue 23068020: Fix performance regression on Tracer: recognize _doublePow in Math. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | 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) 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 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 return Array::length_offset(); 2521 return Array::length_offset();
2522 default: 2522 default:
2523 UNREACHABLE(); 2523 UNREACHABLE();
2524 return -1; 2524 return -1;
2525 } 2525 }
2526 } 2526 }
2527 2527
2528 2528
2529 InvokeMathCFunctionInstr::InvokeMathCFunctionInstr( 2529 InvokeMathCFunctionInstr::InvokeMathCFunctionInstr(
2530 ZoneGrowableArray<Value*>* inputs, 2530 ZoneGrowableArray<Value*>* inputs,
2531 InstanceCallInstr* instance_call, 2531 intptr_t original_deopt_id,
2532 MethodRecognizer::Kind recognized_kind) 2532 MethodRecognizer::Kind recognized_kind)
2533 : inputs_(inputs), 2533 : inputs_(inputs),
2534 locs_(NULL), 2534 locs_(NULL),
2535 recognized_kind_(recognized_kind) { 2535 recognized_kind_(recognized_kind) {
2536 ASSERT(inputs_->length() == ArgumentCountFor(recognized_kind_)); 2536 ASSERT(inputs_->length() == ArgumentCountFor(recognized_kind_));
2537 for (intptr_t i = 0; i < inputs_->length(); ++i) { 2537 for (intptr_t i = 0; i < inputs_->length(); ++i) {
2538 ASSERT((*inputs)[i] != NULL); 2538 ASSERT((*inputs)[i] != NULL);
2539 (*inputs)[i]->set_instruction(this); 2539 (*inputs)[i]->set_instruction(this);
2540 (*inputs)[i]->set_use_index(i); 2540 (*inputs)[i]->set_use_index(i);
2541 } 2541 }
2542 deopt_id_ = instance_call->deopt_id(); 2542 deopt_id_ = original_deopt_id;
2543 } 2543 }
2544 2544
2545 2545
2546 intptr_t InvokeMathCFunctionInstr::ArgumentCountFor( 2546 intptr_t InvokeMathCFunctionInstr::ArgumentCountFor(
2547 MethodRecognizer::Kind kind) { 2547 MethodRecognizer::Kind kind) {
2548 switch (kind) { 2548 switch (kind) {
2549 case MethodRecognizer::kDoubleTruncate: 2549 case MethodRecognizer::kDoubleTruncate:
2550 case MethodRecognizer::kDoubleFloor: 2550 case MethodRecognizer::kDoubleFloor:
2551 case MethodRecognizer::kDoubleCeil: { 2551 case MethodRecognizer::kDoubleCeil: {
2552 ASSERT(!CPUFeatures::double_truncate_round_supported()); 2552 ASSERT(!CPUFeatures::double_truncate_round_supported());
2553 return 1; 2553 return 1;
2554 } 2554 }
2555 case MethodRecognizer::kDoubleRound: 2555 case MethodRecognizer::kDoubleRound:
2556 return 1; 2556 return 1;
2557 case MethodRecognizer::kDoubleMod: 2557 case MethodRecognizer::kDoubleMod:
2558 case MethodRecognizer::kDoublePow: 2558 case MethodRecognizer::kMathDoublePow:
2559 return 2; 2559 return 2;
2560 default: 2560 default:
2561 UNREACHABLE(); 2561 UNREACHABLE();
2562 } 2562 }
2563 return 0; 2563 return 0;
2564 } 2564 }
2565 2565
2566 // Use expected function signatures to help MSVC compiler resolve overloading. 2566 // Use expected function signatures to help MSVC compiler resolve overloading.
2567 typedef double (*UnaryMathCFunction) (double x); 2567 typedef double (*UnaryMathCFunction) (double x);
2568 typedef double (*BinaryMathCFunction) (double x, double y); 2568 typedef double (*BinaryMathCFunction) (double x, double y);
(...skipping 26 matching lines...) Expand all
2595 const RuntimeEntry& InvokeMathCFunctionInstr::TargetFunction() const { 2595 const RuntimeEntry& InvokeMathCFunctionInstr::TargetFunction() const {
2596 switch (recognized_kind_) { 2596 switch (recognized_kind_) {
2597 case MethodRecognizer::kDoubleTruncate: 2597 case MethodRecognizer::kDoubleTruncate:
2598 return kTruncRuntimeEntry; 2598 return kTruncRuntimeEntry;
2599 case MethodRecognizer::kDoubleRound: 2599 case MethodRecognizer::kDoubleRound:
2600 return kRoundRuntimeEntry; 2600 return kRoundRuntimeEntry;
2601 case MethodRecognizer::kDoubleFloor: 2601 case MethodRecognizer::kDoubleFloor:
2602 return kFloorRuntimeEntry; 2602 return kFloorRuntimeEntry;
2603 case MethodRecognizer::kDoubleCeil: 2603 case MethodRecognizer::kDoubleCeil:
2604 return kCeilRuntimeEntry; 2604 return kCeilRuntimeEntry;
2605 case MethodRecognizer::kDoublePow: 2605 case MethodRecognizer::kMathDoublePow:
2606 return kPowRuntimeEntry; 2606 return kPowRuntimeEntry;
2607 case MethodRecognizer::kDoubleMod: 2607 case MethodRecognizer::kDoubleMod:
2608 return kModRuntimeEntry; 2608 return kModRuntimeEntry;
2609 default: 2609 default:
2610 UNREACHABLE(); 2610 UNREACHABLE();
2611 } 2611 }
2612 return kPowRuntimeEntry; 2612 return kPowRuntimeEntry;
2613 } 2613 }
2614 2614
2615 2615
2616 #undef __ 2616 #undef __
2617 2617
2618 } // namespace dart 2618 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698