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

Unified Diff: src/runtime.cc

Issue 223193005: Get rid of the TRANSITION PropertyType and consistently use CanHoldValue(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use number_ for LastAdded in transition results. Created 6 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/property-details.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index fe5d15f6be3ed5140c607d2f450d70426dd98c2e..5e9d9d80097516ca6387bbc0449e24678324ed1f 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -5216,23 +5216,23 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) {
CONVERT_ARG_HANDLE_CHECKED(Name, key, 1);
LookupResult lookup(isolate);
object->LookupRealNamedProperty(*key, &lookup);
- if (!lookup.IsFound()) return isolate->heap()->undefined_value();
- switch (lookup.type()) {
- case NORMAL:
- return lookup.holder()->GetNormalizedProperty(&lookup);
- case FIELD:
- return lookup.holder()->FastPropertyAt(
- lookup.representation(),
- lookup.GetFieldIndex().field_index());
- case CONSTANT:
- return lookup.GetConstant();
- case CALLBACKS:
- case HANDLER:
- case INTERCEPTOR:
- case TRANSITION:
- return isolate->heap()->undefined_value();
- case NONEXISTENT:
- UNREACHABLE();
+ if (lookup.IsFound() && !lookup.IsTransition()) {
+ switch (lookup.type()) {
+ case NORMAL:
+ return lookup.holder()->GetNormalizedProperty(&lookup);
+ case FIELD:
+ return lookup.holder()->FastPropertyAt(
+ lookup.representation(),
+ lookup.GetFieldIndex().field_index());
+ case CONSTANT:
+ return lookup.GetConstant();
+ case CALLBACKS:
+ case HANDLER:
+ case INTERCEPTOR:
+ break;
+ case NONEXISTENT:
+ UNREACHABLE();
+ }
}
return isolate->heap()->undefined_value();
}
@@ -10780,6 +10780,7 @@ static MaybeObject* DebugLookupResultValue(Heap* heap,
LookupResult* result,
bool* caught_exception) {
Object* value;
+ if (result->IsTransition()) return heap->undefined_value();
switch (result->type()) {
case NORMAL:
value = result->holder()->GetNormalizedProperty(result);
@@ -10823,7 +10824,6 @@ static MaybeObject* DebugLookupResultValue(Heap* heap,
}
}
case INTERCEPTOR:
- case TRANSITION:
return heap->undefined_value();
case HANDLER:
case NONEXISTENT:
« no previous file with comments | « src/property-details.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698