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

Unified Diff: src/runtime.cc

Issue 113821: Execute accessor for the debugged property if it's a native function (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 7 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 | « no previous file | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 2034)
+++ src/runtime.cc (working copy)
@@ -5485,7 +5485,8 @@
}
-static Object* DebugLookupResultValue(Object* receiver, LookupResult* result,
+static Object* DebugLookupResultValue(Object* receiver, String* name,
+ LookupResult* result,
bool* caught_exception) {
Object* value;
switch (result->type()) {
@@ -5510,11 +5511,18 @@
return result->GetConstantFunction();
case CALLBACKS: {
Object* structure = result->GetCallbackObject();
- if (structure->IsProxy()) {
- AccessorDescriptor* callback =
- reinterpret_cast<AccessorDescriptor*>(
- Proxy::cast(structure)->proxy());
- value = (callback->getter)(receiver, callback->data);
+ if (structure->IsProxy() || structure->IsAccessorInfo()) {
+ if (Debug::debugger_entry()) {
+ // SaveContext scope. It will restore debugger context after the
+ // getter execution.
+ SaveContext save;
+ Top::set_context(*Debug::debugger_entry()->GetContext());
+ value = receiver->GetPropertyWithCallback(
+ receiver, structure, name, result->holder());
+ } else {
+ value = receiver->GetPropertyWithCallback(
+ receiver, structure, name, result->holder());
+ }
if (value->IsException()) {
value = Top::pending_exception();
Top::clear_pending_exception();
@@ -5595,7 +5603,7 @@
if (result.IsProperty()) {
bool caught_exception = false;
- Object* value = DebugLookupResultValue(*obj, &result,
+ Object* value = DebugLookupResultValue(*obj, *name, &result,
&caught_exception);
if (value->IsFailure()) return value;
Handle<Object> value_handle(value);
@@ -5631,7 +5639,7 @@
LookupResult result;
obj->Lookup(*name, &result);
if (result.IsProperty()) {
- return DebugLookupResultValue(*obj, &result, NULL);
+ return DebugLookupResultValue(*obj, *name, &result, NULL);
}
return Heap::undefined_value();
}
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698