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

Unified Diff: runtime/vm/intrinsifier.cc

Issue 15743017: Adds a flag to the standalone vm to throw an exception on 53-bit integer overflow. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intrinsifier.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier.cc
===================================================================
--- runtime/vm/intrinsifier.cc (revision 23635)
+++ runtime/vm/intrinsifier.cc (working copy)
@@ -11,8 +11,8 @@
namespace dart {
DEFINE_FLAG(bool, intrinsify, true, "Instrinsify when possible");
+DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
-
static bool CompareNames(const Library& lib,
const char* test_name,
const char* name) {
@@ -98,6 +98,7 @@
Function& func = Function::Handle(isolate);
String& str = String::Handle(isolate);
Error& error = Error::Handle(isolate);
+ bool set_intrinsic = true;
#define SETUP_FUNCTION(class_name, function_name, destination, fp) \
if (strcmp(#class_name, "::") == 0) { \
@@ -117,12 +118,18 @@
func = cls.LookupFunctionAllowPrivate(str); \
} \
ASSERT(!func.IsNull()); \
- func.set_is_intrinsic(true); \
+ func.set_is_intrinsic(set_intrinsic); \
// Set up all core lib functions that can be intrisified.
lib = Library::CoreLibrary();
CORE_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
+ // Integer intrinsics are in the core library, but we don't want to intrinsify
+ // if we are looking for javascript integer overflow.
+ set_intrinsic = !FLAG_throw_on_javascript_int_overflow;
+ CORE_INTEGER_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
+ set_intrinsic = true;
+
// Set up all math lib functions that can be intrisified.
lib = Library::MathLibrary();
MATH_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
@@ -153,6 +160,7 @@
if (lib.raw() == Library::CoreLibrary()) {
CORE_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
+ CORE_INTEGER_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
} else if (lib.raw() == Library::TypedDataLibrary()) {
TYPED_DATA_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
} else if (lib.raw() == Library::MathLibrary()) {
« no previous file with comments | « runtime/vm/intrinsifier.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698