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

Side by Side Diff: runtime/lib/integers.cc

Issue 1414493003: Remove some Isolate::current_zone() calls, as it gets the zone from mutator thread not the current … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Zones and commentw Created 5 years, 2 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 | « runtime/lib/bool.cc ('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 #include "vm/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 GET_NON_NULL_NATIVE_ARGUMENT(String, value, arguments->NativeArgAt(0)); 230 GET_NON_NULL_NATIVE_ARGUMENT(String, value, arguments->NativeArgAt(0));
231 return ParseInteger(value); 231 return ParseInteger(value);
232 } 232 }
233 233
234 234
235 DEFINE_NATIVE_ENTRY(Integer_fromEnvironment, 3) { 235 DEFINE_NATIVE_ENTRY(Integer_fromEnvironment, 3) {
236 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(1)); 236 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(1));
237 GET_NATIVE_ARGUMENT(Integer, default_value, arguments->NativeArgAt(2)); 237 GET_NATIVE_ARGUMENT(Integer, default_value, arguments->NativeArgAt(2));
238 // Call the embedder to supply us with the environment. 238 // Call the embedder to supply us with the environment.
239 const String& env_value = 239 const String& env_value =
240 String::Handle(Api::CallEnvironmentCallback(isolate, name)); 240 String::Handle(Api::CallEnvironmentCallback(thread, name));
241 if (!env_value.IsNull()) { 241 if (!env_value.IsNull()) {
242 const Integer& result = Integer::Handle(ParseInteger(env_value)); 242 const Integer& result = Integer::Handle(ParseInteger(env_value));
243 if (!result.IsNull()) { 243 if (!result.IsNull()) {
244 if (result.IsSmi()) { 244 if (result.IsSmi()) {
245 return result.raw(); 245 return result.raw();
246 } 246 }
247 return result.CheckAndCanonicalize(NULL); 247 return result.CheckAndCanonicalize(NULL);
248 } 248 }
249 } 249 }
250 return default_value.raw(); 250 return default_value.raw();
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 DEFINE_NATIVE_ENTRY(Bigint_allocate, 4) { 426 DEFINE_NATIVE_ENTRY(Bigint_allocate, 4) {
427 // First arg is null type arguments, since class Bigint is not parameterized. 427 // First arg is null type arguments, since class Bigint is not parameterized.
428 const Bool& neg = Bool::CheckedHandle(arguments->NativeArgAt(1)); 428 const Bool& neg = Bool::CheckedHandle(arguments->NativeArgAt(1));
429 const Smi& used = Smi::CheckedHandle(arguments->NativeArgAt(2)); 429 const Smi& used = Smi::CheckedHandle(arguments->NativeArgAt(2));
430 const TypedData& digits = TypedData::CheckedHandle(arguments->NativeArgAt(3)); 430 const TypedData& digits = TypedData::CheckedHandle(arguments->NativeArgAt(3));
431 ASSERT(!digits.IsNull()); 431 ASSERT(!digits.IsNull());
432 return Bigint::New(neg.value(), used.Value(), digits); 432 return Bigint::New(neg.value(), used.Value(), digits);
433 } 433 }
434 434
435 } // namespace dart 435 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/bool.cc ('k') | runtime/lib/string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698