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

Side by Side Diff: runtime/lib/math_patch.dart

Issue 12871010: Replace scalarlist optimizations and split external array loads into two IL instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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/lib/core_patch.dart ('k') | runtime/lib/string.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import "dart:scalarlist"; 5 import "dart:typeddata";
6 6
7 // A VM patch of the dart:math library. 7 // A VM patch of the dart:math library.
8 patch num pow(num x, num exponent) { 8 patch num pow(num x, num exponent) {
9 if (exponent is int) { 9 if (exponent is int) {
10 return x.pow(exponent); 10 return x.pow(exponent);
11 } 11 }
12 // Double.pow will call exponent.toDouble(). 12 // Double.pow will call exponent.toDouble().
13 return x.toDouble().pow(exponent); 13 return x.toDouble().pow(exponent);
14 } 14 }
15 15
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 static int _nextSeed() { 113 static int _nextSeed() {
114 if (_prng == null) { 114 if (_prng == null) {
115 // TODO(iposva): Use system to get a random seed. 115 // TODO(iposva): Use system to get a random seed.
116 _prng = new Random(new DateTime.now().millisecondsSinceEpoch); 116 _prng = new Random(new DateTime.now().millisecondsSinceEpoch);
117 } 117 }
118 // Trigger the PRNG once to change the internal state. 118 // Trigger the PRNG once to change the internal state.
119 return _prng._nextInt32(); 119 return _prng._nextInt32();
120 } 120 }
121 } 121 }
OLDNEW
« no previous file with comments | « runtime/lib/core_patch.dart ('k') | runtime/lib/string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698