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

Unified Diff: src/ic.cc

Issue 647015: Remove the LookupResult IsValid method because it is confusing.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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/ia32/stub-cache-ia32.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
===================================================================
--- src/ic.cc (revision 3900)
+++ src/ic.cc (working copy)
@@ -330,10 +330,11 @@
while (true) {
object->Lookup(name, lookup);
// Besides normal conditions (property not found or it's not
- // an interceptor), bail out of lookup is not cacheable: we won't
+ // an interceptor), bail out if lookup is not cacheable: we won't
// be able to IC it anyway and regular lookup should work fine.
- if (lookup->IsNotFound() || lookup->type() != INTERCEPTOR ||
- !lookup->IsCacheable()) {
+ if (!lookup->IsFound()
+ || (lookup->type() != INTERCEPTOR)
+ || !lookup->IsCacheable()) {
return;
}
@@ -343,7 +344,7 @@
}
holder->LocalLookupRealNamedProperty(name, lookup);
- if (lookup->IsValid()) {
+ if (lookup->IsProperty()) {
ASSERT(lookup->type() != INTERCEPTOR);
return;
}
@@ -422,7 +423,7 @@
LookupResult lookup;
LookupForRead(*object, *name, &lookup);
- if (!lookup.IsValid()) {
+ if (!lookup.IsProperty()) {
// If the object does not have the requested property, check which
// exception we need to throw.
if (IsContextual(object)) {
@@ -493,7 +494,7 @@
Handle<String> name) {
ASSERT(lookup->IsLoaded());
// Bail out if we didn't find a result.
- if (!lookup->IsValid() || !lookup->IsCacheable()) return;
+ if (!lookup->IsProperty() || !lookup->IsCacheable()) return;
// Compute the number of arguments.
int argc = target()->arguments_count();
@@ -642,8 +643,8 @@
LookupResult lookup;
LookupForRead(*object, *name, &lookup);
- // If lookup is invalid, check if we need to throw an exception.
- if (!lookup.IsValid()) {
+ // If we did not find a property, check if we need to throw an exception.
+ if (!lookup.IsProperty()) {
if (FLAG_strict || IsContextual(object)) {
return ReferenceError("not_defined", name);
}
@@ -653,7 +654,7 @@
bool can_be_inlined =
FLAG_use_ic &&
state == PREMONOMORPHIC &&
- lookup.IsValid() &&
+ lookup.IsProperty() &&
lookup.IsLoaded() &&
lookup.IsCacheable() &&
lookup.holder() == *object &&
@@ -681,7 +682,7 @@
}
PropertyAttributes attr;
- if (lookup.IsValid() && lookup.type() == INTERCEPTOR) {
+ if (lookup.IsProperty() && lookup.type() == INTERCEPTOR) {
// Get the property.
Object* result = object->GetProperty(*object, &lookup, *name, &attr);
if (result->IsFailure()) return result;
@@ -704,7 +705,7 @@
Handle<String> name) {
ASSERT(lookup->IsLoaded());
// Bail out if we didn't find a result.
- if (!lookup->IsValid() || !lookup->IsCacheable()) return;
+ if (!lookup->IsProperty() || !lookup->IsCacheable()) return;
// Loading properties from values is not common, so don't try to
// deal with non-JS objects here.
@@ -857,8 +858,8 @@
LookupResult lookup;
LookupForRead(*object, *name, &lookup);
- // If lookup is invalid, check if we need to throw an exception.
- if (!lookup.IsValid()) {
+ // If we did not find a property, check if we need to throw an exception.
+ if (!lookup.IsProperty()) {
if (FLAG_strict || IsContextual(object)) {
return ReferenceError("not_defined", name);
}
@@ -869,7 +870,7 @@
}
PropertyAttributes attr;
- if (lookup.IsValid() && lookup.type() == INTERCEPTOR) {
+ if (lookup.IsProperty() && lookup.type() == INTERCEPTOR) {
// Get the property.
Object* result = object->GetProperty(*object, &lookup, *name, &attr);
if (result->IsFailure()) return result;
@@ -921,7 +922,7 @@
Handle<Object> object, Handle<String> name) {
ASSERT(lookup->IsLoaded());
// Bail out if we didn't find a result.
- if (!lookup->IsValid() || !lookup->IsCacheable()) return;
+ if (!lookup->IsProperty() || !lookup->IsCacheable()) return;
if (!object->IsJSObject()) return;
Handle<JSObject> receiver = Handle<JSObject>::cast(object);
@@ -994,7 +995,7 @@
static bool StoreICableLookup(LookupResult* lookup) {
// Bail out if we didn't find a result.
- if (!lookup->IsValid() || !lookup->IsCacheable()) return false;
+ if (!lookup->IsPropertyOrTransition() || !lookup->IsCacheable()) return false;
// If the property is read-only, we leave the IC in its current
// state.
@@ -1214,7 +1215,7 @@
if (receiver->IsJSGlobalProxy()) return;
// Bail out if we didn't find a result.
- if (!lookup->IsValid() || !lookup->IsCacheable()) return;
+ if (!lookup->IsPropertyOrTransition() || !lookup->IsCacheable()) return;
// If the property is read-only, we leave the IC in its current
// state.
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698