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

Side by Side Diff: src/runtime/runtime-maths.cc

Issue 1468313004: Make fast_exp take an Isolate* paramter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « src/ppc/codegen-ppc.cc ('k') | src/x64/codegen-x64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/base/utils/random-number-generator.h" 9 #include "src/base/utils/random-number-generator.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 return *isolate->factory()->NewNumber(result); 99 return *isolate->factory()->NewNumber(result);
100 } 100 }
101 101
102 102
103 RUNTIME_FUNCTION(Runtime_MathExpRT) { 103 RUNTIME_FUNCTION(Runtime_MathExpRT) {
104 HandleScope scope(isolate); 104 HandleScope scope(isolate);
105 DCHECK(args.length() == 1); 105 DCHECK(args.length() == 1);
106 isolate->counters()->math_exp()->Increment(); 106 isolate->counters()->math_exp()->Increment();
107 107
108 CONVERT_DOUBLE_ARG_CHECKED(x, 0); 108 CONVERT_DOUBLE_ARG_CHECKED(x, 0);
109 lazily_initialize_fast_exp(); 109 lazily_initialize_fast_exp(isolate);
110 return *isolate->factory()->NewNumber(fast_exp(x)); 110 return *isolate->factory()->NewNumber(fast_exp(x, isolate));
111 } 111 }
112 112
113 113
114 RUNTIME_FUNCTION(Runtime_MathClz32) { 114 RUNTIME_FUNCTION(Runtime_MathClz32) {
115 HandleScope scope(isolate); 115 HandleScope scope(isolate);
116 DCHECK(args.length() == 1); 116 DCHECK(args.length() == 1);
117 isolate->counters()->math_clz32()->Increment(); 117 isolate->counters()->math_clz32()->Increment();
118 118
119 CONVERT_NUMBER_CHECKED(uint32_t, x, Uint32, args[0]); 119 CONVERT_NUMBER_CHECKED(uint32_t, x, Uint32, args[0]);
120 return *isolate->factory()->NewNumberFromUint( 120 return *isolate->factory()->NewNumberFromUint(
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 uint16_t seeds[kSize]; 255 uint16_t seeds[kSize];
256 do { 256 do {
257 isolate->random_number_generator()->NextBytes(seeds, 257 isolate->random_number_generator()->NextBytes(seeds,
258 kSize * sizeof(*seeds)); 258 kSize * sizeof(*seeds));
259 } while (!(seeds[0] && seeds[1] && seeds[2] && seeds[3])); 259 } while (!(seeds[0] && seeds[1] && seeds[2] && seeds[3]));
260 for (int i = 0; i < kSize; i++) array->set(i, Smi::FromInt(seeds[i])); 260 for (int i = 0; i < kSize; i++) array->set(i, Smi::FromInt(seeds[i]));
261 return *isolate->factory()->NewJSArrayWithElements(array); 261 return *isolate->factory()->NewJSArrayWithElements(array);
262 } 262 }
263 } // namespace internal 263 } // namespace internal
264 } // namespace v8 264 } // namespace v8
OLDNEW
« no previous file with comments | « src/ppc/codegen-ppc.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698