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

Unified Diff: src/debug-debugger.js

Issue 6580038: [Isolates] Merge from bleeding_edge, revisions 5934-6100. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.cc ('k') | src/deoptimizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-debugger.js
===================================================================
--- src/debug-debugger.js (revision 6904)
+++ src/debug-debugger.js (working copy)
@@ -858,6 +858,7 @@
return debugger_flags;
};
+Debug.MakeMirror = MakeMirror;
function MakeExecutionState(break_id) {
return new ExecutionState(break_id);
@@ -876,9 +877,11 @@
return %PrepareStep(this.break_id, action, count);
}
-ExecutionState.prototype.evaluateGlobal = function(source, disable_break) {
- return MakeMirror(
- %DebugEvaluateGlobal(this.break_id, source, Boolean(disable_break)));
+ExecutionState.prototype.evaluateGlobal = function(source, disable_break,
+ opt_additional_context) {
+ return MakeMirror(%DebugEvaluateGlobal(this.break_id, source,
+ Boolean(disable_break),
+ opt_additional_context));
};
ExecutionState.prototype.frameCount = function() {
@@ -1837,6 +1840,7 @@
var frame = request.arguments.frame;
var global = request.arguments.global;
var disable_break = request.arguments.disable_break;
+ var additional_context = request.arguments.additional_context;
// The expression argument could be an integer so we convert it to a
// string.
@@ -1850,12 +1854,30 @@
if (!IS_UNDEFINED(frame) && global) {
return response.failed('Arguments "frame" and "global" are exclusive');
}
+
+ var additional_context_object;
+ if (additional_context) {
+ additional_context_object = {};
+ for (var i = 0; i < additional_context.length; i++) {
+ var mapping = additional_context[i];
+ if (!IS_STRING(mapping.name) || !IS_NUMBER(mapping.handle)) {
+ return response.failed("Context element #" + i +
+ " must contain name:string and handle:number");
+ }
+ var context_value_mirror = LookupMirror(mapping.handle);
+ if (!context_value_mirror) {
+ return response.failed("Context object '" + mapping.name +
+ "' #" + mapping.handle + "# not found");
+ }
+ additional_context_object[mapping.name] = context_value_mirror.value();
+ }
+ }
// Global evaluate.
if (global) {
// Evaluate in the global context.
- response.body =
- this.exec_state_.evaluateGlobal(expression, Boolean(disable_break));
+ response.body = this.exec_state_.evaluateGlobal(
+ expression, Boolean(disable_break), additional_context_object);
return;
}
@@ -1877,12 +1899,12 @@
}
// Evaluate in the specified frame.
response.body = this.exec_state_.frame(frame_number).evaluate(
- expression, Boolean(disable_break));
+ expression, Boolean(disable_break), additional_context_object);
return;
} else {
// Evaluate in the selected frame.
response.body = this.exec_state_.frame().evaluate(
- expression, Boolean(disable_break));
+ expression, Boolean(disable_break), additional_context_object);
return;
}
};
« no previous file with comments | « src/debug.cc ('k') | src/deoptimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698