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

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

Issue 14057004: Convert diamond shaped control flow into a single conditional instruction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Florian's comments Created 7 years, 8 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/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after
2032 range_ = new Range(RangeBoundary::FromConstant(0), 2032 range_ = new Range(RangeBoundary::FromConstant(0),
2033 RangeBoundary::FromConstant(0xFFFF)); 2033 RangeBoundary::FromConstant(0xFFFF));
2034 break; 2034 break;
2035 default: 2035 default:
2036 Definition::InferRange(); 2036 Definition::InferRange();
2037 break; 2037 break;
2038 } 2038 }
2039 } 2039 }
2040 2040
2041 2041
2042 void IfThenElseInstr::InferRange() {
2043 const intptr_t min = Utils::Minimum(if_true_, if_false_);
2044 const intptr_t max = Utils::Maximum(if_true_, if_false_);
2045 range_ = new Range(RangeBoundary::FromConstant(min),
2046 RangeBoundary::FromConstant(max));
2047 }
2048
2049
2042 void PhiInstr::InferRange() { 2050 void PhiInstr::InferRange() {
2043 RangeBoundary new_min; 2051 RangeBoundary new_min;
2044 RangeBoundary new_max; 2052 RangeBoundary new_max;
2045 2053
2046 for (intptr_t i = 0; i < InputCount(); i++) { 2054 for (intptr_t i = 0; i < InputCount(); i++) {
2047 Range* input_range = InputAt(i)->definition()->range(); 2055 Range* input_range = InputAt(i)->definition()->range();
2048 if (input_range == NULL) { 2056 if (input_range == NULL) {
2049 range_ = Range::Unknown(); 2057 range_ = Range::Unknown();
2050 return; 2058 return;
2051 } 2059 }
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
2372 default: 2380 default:
2373 UNREACHABLE(); 2381 UNREACHABLE();
2374 } 2382 }
2375 return kPowRuntimeEntry; 2383 return kPowRuntimeEntry;
2376 } 2384 }
2377 2385
2378 2386
2379 #undef __ 2387 #undef __
2380 2388
2381 } // namespace dart 2389 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698