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

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

Issue 2708213004: Introduce a flag --limit-ints-to-64-bits in the VM in order to investigate the (Closed)
Patch Set: work in progress Created 3 years, 10 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 | « no previous file | runtime/vm/exceptions.h » ('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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 } 402 }
403 403
404 404
405 DEFINE_NATIVE_ENTRY(Bigint_getDigits, 1) { 405 DEFINE_NATIVE_ENTRY(Bigint_getDigits, 1) {
406 const Bigint& bigint = Bigint::CheckedHandle(arguments->NativeArgAt(0)); 406 const Bigint& bigint = Bigint::CheckedHandle(arguments->NativeArgAt(0));
407 return bigint.digits(); 407 return bigint.digits();
408 } 408 }
409 409
410 410
411 DEFINE_NATIVE_ENTRY(Bigint_allocate, 4) { 411 DEFINE_NATIVE_ENTRY(Bigint_allocate, 4) {
412 if (FLAG_limit_ints_to_64_bits) {
413 // The allocated Bigint value is not necessarily out of range, but it may
414 // be used as an operand in an operation resulting in a Bigint.
415 Exceptions::ThrowRangeErrorMsg(
416 "Integer operand requires conversion to Bigint");
417 }
412 // First arg is null type arguments, since class Bigint is not parameterized. 418 // First arg is null type arguments, since class Bigint is not parameterized.
413 const Bool& neg = Bool::CheckedHandle(arguments->NativeArgAt(1)); 419 const Bool& neg = Bool::CheckedHandle(arguments->NativeArgAt(1));
414 const Smi& used = Smi::CheckedHandle(arguments->NativeArgAt(2)); 420 const Smi& used = Smi::CheckedHandle(arguments->NativeArgAt(2));
415 const TypedData& digits = TypedData::CheckedHandle(arguments->NativeArgAt(3)); 421 const TypedData& digits = TypedData::CheckedHandle(arguments->NativeArgAt(3));
416 ASSERT(!digits.IsNull()); 422 ASSERT(!digits.IsNull());
417 return Bigint::New(neg.value(), used.Value(), digits); 423 return Bigint::New(neg.value(), used.Value(), digits);
418 } 424 }
419 425
420 } // namespace dart 426 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/exceptions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698