Author: [email protected]
Date: Fri Jun 5 06:42:29 2009
New Revision: 2111
Modified:
branches/bleeding_edge/src/ic.cc
branches/bleeding_edge/test/cctest/test-api.cc
Log:
Revert r2110 as it introduces performance regressions.
Modified: branches/bleeding_edge/src/ic.cc
==============================================================================
--- branches/bleeding_edge/src/ic.cc (original)
+++ branches/bleeding_edge/src/ic.cc Fri Jun 5 06:42:29 2009
@@ -849,20 +849,6 @@
}
-static bool StoreICableLookup(LookupResult* lookup) {
- // Bail out if we didn't find a result.
- if (!lookup->IsValid() || !lookup->IsCacheable()) return false;
-
- // If the property is read-only, we leave the IC in its current
- // state.
- if (lookup->IsReadOnly()) return false;
-
- if (!lookup->IsLoaded()) return false;
-
- return true;
-}
-
-
Object* StoreIC::Store(State state,
Handle<Object> object,
Handle<String> name,
@@ -887,12 +873,12 @@
}
// Lookup the property locally in the receiver.
- if (FLAG_use_ic && !receiver->IsJSGlobalProxy()) {
- LookupResult lookup;
- receiver->LocalLookup(*name, &lookup);
- if (StoreICableLookup(&lookup)) {
- UpdateCaches(&lookup, state, receiver, name, value);
- }
+ LookupResult lookup;
+ receiver->LocalLookup(*name, &lookup);
+
+ // Update inline cache and stub cache.
+ if (FLAG_use_ic && lookup.IsLoaded()) {
+ UpdateCaches(&lookup, state, receiver, name, value);
}
// Set the property.
@@ -907,9 +893,14 @@
Handle<Object> value) {
ASSERT(lookup->IsLoaded());
// Skip JSGlobalProxy.
- ASSERT(!receiver->IsJSGlobalProxy());
+ if (receiver->IsJSGlobalProxy()) return;
- ASSERT(StoreICableLookup(lookup));
+ // Bail out if we didn't find a result.
+ if (!lookup->IsValid() || !lookup->IsCacheable()) return;
+
+ // If the property is read-only, we leave the IC in its current
+ // state.
+ if (lookup->IsReadOnly()) return;
// If the property has a non-field type allowing map transitions
// where there is extra room in the object, we leave the IC in its
Modified: branches/bleeding_edge/test/cctest/test-api.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-api.cc (original)
+++ branches/bleeding_edge/test/cctest/test-api.cc Fri Jun 5 06:42:29 2009
@@ -4974,22 +4974,6 @@
}
-THREADED_TEST(InterceptorStoreICWithNoSetter) {
- v8::HandleScope scope;
- v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New();
- templ->SetNamedPropertyHandler(InterceptorLoadXICGetter);
- LocalContext context;
- context->Global()->Set(v8_str("o"), templ->NewInstance());
- v8::Handle<Value> value = CompileRun(
- "for (var i = 0; i < 1000; i++) {"
- " o.y = 239;"
- "}"
- "42 + o.y");
- CHECK_EQ(239 + 42, value->Int32Value());
-}
-
-
-
v8::Handle<Value> call_ic_function;
v8::Handle<Value> call_ic_function2;
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---