Version 2.4.5
Changed the RegExp benchmark to exercise the regexp engine on different inputs by scrambling the input strings.
Fixed a bug in keyed loads on strings.
Fixed a bug with loading global function prototypes.
Fixed a bug with profiling RegExp calls (issue http://crbug.com/55999).
Performance improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@5502 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/runtime.cc b/src/runtime.cc
index 627ea12..9e16bc4 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -946,7 +946,7 @@
Handle<String> name(String::cast(args[1]));
PropertyAttributes mode =
static_cast<PropertyAttributes>(Smi::cast(args[2])->value());
- ASSERT(mode == READ_ONLY || mode == NONE);
+ RUNTIME_ASSERT(mode == READ_ONLY || mode == NONE);
Handle<Object> initial_value(args[3]);
// Declarations are always done in the function context.
@@ -8944,24 +8944,39 @@
}
-// Change the state of break on exceptions
-// args[0]: boolean indicating uncaught exceptions
-// args[1]: boolean indicating on/off
+// Change the state of break on exceptions.
+// args[0]: Enum value indicating whether to affect caught/uncaught exceptions.
+// args[1]: Boolean indicating on/off.
static Object* Runtime_ChangeBreakOnException(Arguments args) {
HandleScope scope;
ASSERT(args.length() == 2);
- ASSERT(args[0]->IsNumber());
- ASSERT(args[1]->IsBoolean());
+ RUNTIME_ASSERT(args[0]->IsNumber());
+ CONVERT_BOOLEAN_CHECKED(enable, args[1]);
- // Update break point state
+ // If the number doesn't match an enum value, the ChangeBreakOnException
+ // function will default to affecting caught exceptions.
ExceptionBreakType type =
static_cast<ExceptionBreakType>(NumberToUint32(args[0]));
- bool enable = args[1]->ToBoolean()->IsTrue();
+ // Update break point state.
Debug::ChangeBreakOnException(type, enable);
return Heap::undefined_value();
}
+// Returns the state of break on exceptions
+// args[0]: boolean indicating uncaught exceptions
+static Object* Runtime_IsBreakOnException(Arguments args) {
+ HandleScope scope;
+ ASSERT(args.length() == 1);
+ RUNTIME_ASSERT(args[0]->IsNumber());
+
+ ExceptionBreakType type =
+ static_cast<ExceptionBreakType>(NumberToUint32(args[0]));
+ bool result = Debug::IsBreakOnException(type);
+ return Smi::FromInt(result);
+}
+
+
// Prepare for stepping
// args[0]: break id for checking execution state
// args[1]: step action from the enumeration StepAction