Revision: 16395
Author: [email protected]
Date: Wed Aug 28 12:36:46 2013 UTC
Log: Simplify logic by extracting local lookup before the switch.
[email protected]
Review URL: https://chromiumcodereview.appspot.com/22901034
http://code.google.com/p/v8/source/detail?r=16395
Modified:
/branches/bleeding_edge/src/objects.cc
=======================================
--- /branches/bleeding_edge/src/objects.cc Tue Aug 27 11:47:52 2013 UTC
+++ /branches/bleeding_edge/src/objects.cc Wed Aug 28 12:36:46 2013 UTC
@@ -4092,6 +4092,11 @@
mode,
extensibility_check);
}
+
+ if (lookup.IsFound() &&
+ (lookup.type() == INTERCEPTOR || lookup.type() == CALLBACKS)) {
+ LocalLookupRealNamedProperty(name_raw, &lookup);
+ }
// Check for accessor in prototype chain removed here in clone.
if (!lookup.IsFound()) {
@@ -4134,31 +4139,14 @@
}
break;
case CALLBACKS:
- // Callbacks are not guaranteed to be installed on the receiver. Also
- // perform a local lookup again. Fall through.
- case INTERCEPTOR:
- self->LocalLookupRealNamedProperty(*name, &lookup);
- if (lookup.IsFound()) {
- if (lookup.IsPropertyCallbacks()) {
- result = ConvertAndSetLocalProperty(
- &lookup, *name, *value, attributes);
- } else if (lookup.IsNormal()) {
- result = self->ReplaceSlowProperty(*name, *value, attributes);
- } else {
- result = SetPropertyToFieldWithAttributes(
- &lookup, name, value, attributes);
- }
- } else {
- result = self->AddProperty(
- *name, *value, attributes, kNonStrictMode,
MAY_BE_STORE_FROM_KEYED,
- extensibility_check, value_type, mode);
- }
+ result = ConvertAndSetLocalProperty(&lookup, *name, *value,
attributes);
break;
case TRANSITION:
result = SetPropertyUsingTransition(&lookup, name, value,
attributes);
break;
+ case NONEXISTENT:
case HANDLER:
- case NONEXISTENT:
+ case INTERCEPTOR:
UNREACHABLE();
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.