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

Unified Diff: src/runtime.cc

Issue 18194: Changes to the V8 debugger support which otherwise caused problems with Chrom... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 11 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/mirror-delay.js ('k') | 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 1100)
+++ src/runtime.cc (working copy)
@@ -4536,32 +4536,49 @@
}
-static Object* DebugLookupResultValue(Object* obj, String* name,
- LookupResult* result,
+static Object* DebugLookupResultValue(Object* receiver, LookupResult* result,
bool* caught_exception) {
+ Object* value;
switch (result->type()) {
- case NORMAL:
+ case NORMAL: {
+ Dictionary* dict =
+ JSObject::cast(result->holder())->property_dictionary();
+ value = dict->ValueAt(result->GetDictionaryEntry());
+ if (value->IsTheHole()) {
+ return Heap::undefined_value();
+ }
+ return value;
+ }
case FIELD:
+ value =
+ JSObject::cast(
+ result->holder())->FastPropertyAt(result->GetFieldIndex());
+ if (value->IsTheHole()) {
+ return Heap::undefined_value();
+ }
+ return value;
case CONSTANT_FUNCTION:
- return obj->GetProperty(name);
+ return result->GetConstantFunction();
case CALLBACKS: {
- // Get the property value. If there is an exception it must be thrown from
- // a JavaScript getter.
- Object* value;
- value = obj->GetProperty(name);
- if (value->IsException()) {
- if (caught_exception != NULL) {
- *caught_exception = true;
+ Object* structure = result->GetCallbackObject();
+ if (structure->IsProxy()) {
+ AccessorDescriptor* callback =
+ reinterpret_cast<AccessorDescriptor*>(
+ Proxy::cast(structure)->proxy());
+ value = (callback->getter)(receiver, callback->data);
+ if (value->IsFailure()) {
+ value = Top::pending_exception();
+ Top::clear_pending_exception();
+ if (caught_exception != NULL) {
+ *caught_exception = true;
+ }
}
- value = Top::pending_exception();
- Top::optional_reschedule_exception(true);
+ return value;
+ } else {
+ return Heap::undefined_value();
}
- ASSERT(!Top::has_pending_exception());
- ASSERT(!Top::external_caught_exception());
- return value;
}
case INTERCEPTOR:
- return obj->GetProperty(name);
case MAP_TRANSITION:
case CONSTANT_TRANSITION:
case NULL_DESCRIPTOR:
@@ -4609,7 +4626,7 @@
obj->LocalLookup(*name, &result);
if (result.IsProperty()) {
bool caught_exception = false;
- Handle<Object> value(DebugLookupResultValue(*obj, *name, &result,
+ Handle<Object> value(DebugLookupResultValue(*obj, &result,
&caught_exception));
// If the callback object is a fixed array then it contains JavaScript
// getter and/or setter.
@@ -4643,7 +4660,7 @@
LookupResult result;
obj->Lookup(*name, &result);
if (result.IsProperty()) {
- return DebugLookupResultValue(*obj, *name, &result, NULL);
+ return DebugLookupResultValue(*obj, &result, NULL);
}
return Heap::undefined_value();
}
« no previous file with comments | « src/mirror-delay.js ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698