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

Unified Diff: src/debug.cc

Issue 6697023: Merge 6800:7180 from the bleeding edge branch to the experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 9 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 | « src/d8.js ('k') | src/debug-debugger.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
===================================================================
--- src/debug.cc (revision 7180)
+++ src/debug.cc (working copy)
@@ -765,15 +765,12 @@
Handle<String> script_name = Factory::NewStringFromAscii(name);
// Compile the script.
- bool allow_natives_syntax = FLAG_allow_natives_syntax;
- FLAG_allow_natives_syntax = true;
Handle<SharedFunctionInfo> function_info;
function_info = Compiler::Compile(source_code,
script_name,
0, 0, NULL, NULL,
Handle<String>::null(),
NATIVES_CODE);
- FLAG_allow_natives_syntax = allow_natives_syntax;
// Silently ignore stack overflows during compilation.
if (function_info.is_null()) {
@@ -837,7 +834,8 @@
Handle<String> key = Factory::LookupAsciiSymbol("builtins");
Handle<GlobalObject> global = Handle<GlobalObject>(context->global());
RETURN_IF_EMPTY_HANDLE_VALUE(
- SetProperty(global, key, Handle<Object>(global->builtins()), NONE),
+ SetProperty(global, key, Handle<Object>(global->builtins()),
+ NONE, kNonStrictMode),
false);
// Compile the JavaScript for the debugger in the debugger context.
@@ -1003,24 +1001,24 @@
// triggered. This function returns a JSArray with the break point objects
// which is triggered.
Handle<Object> Debug::CheckBreakPoints(Handle<Object> break_point_objects) {
+ // Count the number of break points hit. If there are multiple break points
+ // they are in a FixedArray.
+ Handle<FixedArray> break_points_hit;
int break_points_hit_count = 0;
- Handle<JSArray> break_points_hit = Factory::NewJSArray(1);
-
- // If there are multiple break points they are in a FixedArray.
ASSERT(!break_point_objects->IsUndefined());
if (break_point_objects->IsFixedArray()) {
Handle<FixedArray> array(FixedArray::cast(*break_point_objects));
+ break_points_hit = Factory::NewFixedArray(array->length());
for (int i = 0; i < array->length(); i++) {
Handle<Object> o(array->get(i));
if (CheckBreakPoint(o)) {
- SetElement(break_points_hit, break_points_hit_count++, o);
+ break_points_hit->set(break_points_hit_count++, *o);
}
}
} else {
+ break_points_hit = Factory::NewFixedArray(1);
if (CheckBreakPoint(break_point_objects)) {
- SetElement(break_points_hit,
- break_points_hit_count++,
- break_point_objects);
+ break_points_hit->set(break_points_hit_count++, *break_point_objects);
}
}
@@ -1028,7 +1026,10 @@
if (break_points_hit_count == 0) {
return Factory::undefined_value();
}
- return break_points_hit;
+ // Return break points hit as a JSArray.
+ Handle<JSArray> result = Factory::NewJSArrayWithElements(break_points_hit);
+ result->set_length(Smi::FromInt(break_points_hit_count));
+ return result;
}
@@ -1039,7 +1040,7 @@
// Ignore check if break point object is not a JSObject.
if (!break_point_object->IsJSObject()) return true;
- // Get the function CheckBreakPoint (defined in debug.js).
+ // Get the function IsBreakPointTriggered (defined in debug-debugger.js).
Handle<String> is_break_point_triggered_symbol =
Factory::LookupAsciiSymbol("IsBreakPointTriggered");
Handle<JSFunction> check_break_point =
« no previous file with comments | « src/d8.js ('k') | src/debug-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698