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

Unified Diff: src/ic.cc

Issue 422023003: Encapsulate the holder in the PropertyHolderCompilers (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/stub-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index eb84fd14620367b835a5966327ace69f836918e2..1a8366dfeca114a74b8c2c361252908a2062922f 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -942,7 +942,8 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, Handle<Object> object,
Handle<HeapType> type = receiver_type();
Handle<JSObject> holder(lookup->holder());
bool receiver_is_holder = object.is_identical_to(holder);
- NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), cache_holder);
+ NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
+ cache_holder);
switch (lookup->type()) {
case FIELD: {
@@ -950,12 +951,11 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, Handle<Object> object,
if (receiver_is_holder) {
return SimpleFieldLoad(field);
}
- return compiler.CompileLoadField(holder, name, field,
- lookup->representation());
+ return compiler.CompileLoadField(name, field, lookup->representation());
}
case CONSTANT: {
Handle<Object> constant(lookup->GetConstant(), isolate());
- return compiler.CompileLoadConstant(holder, name, constant);
+ return compiler.CompileLoadConstant(name, constant);
}
case NORMAL:
if (kind() != Code::LOAD_IC) break;
@@ -963,8 +963,8 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, Handle<Object> object,
Handle<GlobalObject> global = Handle<GlobalObject>::cast(holder);
Handle<PropertyCell> cell(
global->GetPropertyCell(lookup), isolate());
- Handle<Code> code = compiler.CompileLoadGlobal(global, cell, name,
- lookup->IsDontDelete());
+ Handle<Code> code =
+ compiler.CompileLoadGlobal(cell, name, lookup->IsDontDelete());
// TODO(verwaest): Move caching of these NORMAL stubs outside as well.
CacheHolderFlag flag;
Handle<Map> stub_holder_map =
@@ -1001,7 +1001,8 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, Handle<Object> object,
type)) {
break;
}
- return compiler.CompileLoadCallback(holder, name, info);
+ if (holder->IsGlobalObject()) break;
+ return compiler.CompileLoadCallback(name, info);
} else if (callback->IsAccessorPair()) {
Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter(),
isolate());
@@ -1019,9 +1020,9 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, Handle<Object> object,
CallOptimization call_optimization(function);
if (call_optimization.is_simple_api_call() &&
call_optimization.IsCompatibleReceiver(object, holder)) {
- return compiler.CompileLoadCallback(holder, name, call_optimization);
+ return compiler.CompileLoadCallback(name, call_optimization);
}
- return compiler.CompileLoadViaGetter(holder, name, function);
+ return compiler.CompileLoadViaGetter(name, function);
}
// TODO(dcarney): Handle correctly.
ASSERT(callback->IsDeclaredAccessorInfo());
@@ -1029,7 +1030,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, Handle<Object> object,
}
case INTERCEPTOR:
ASSERT(HasInterceptorGetter(*holder));
- return compiler.CompileLoadInterceptor(holder, name);
+ return compiler.CompileLoadInterceptor(name);
default:
break;
}
@@ -1394,7 +1395,7 @@ Handle<Code> StoreIC::CompileHandler(LookupResult* lookup,
Handle<JSObject> receiver = Handle<JSObject>::cast(object);
Handle<JSObject> holder(lookup->holder());
- NamedStoreHandlerCompiler compiler(isolate(), receiver_type());
+ NamedStoreHandlerCompiler compiler(isolate(), receiver_type(), holder);
if (lookup->IsTransition()) {
// Explicitly pass in the receiver map since LookupForWrite may have
@@ -1403,13 +1404,12 @@ Handle<Code> StoreIC::CompileHandler(LookupResult* lookup,
PropertyDetails details = lookup->GetPropertyDetails();
if (details.type() != CALLBACKS && details.attributes() == NONE) {
- return compiler.CompileStoreTransition(
- receiver, lookup, transition, name);
+ return compiler.CompileStoreTransition(lookup, transition, name);
}
} else {
switch (lookup->type()) {
case FIELD:
- return compiler.CompileStoreField(receiver, lookup, name);
+ return compiler.CompileStoreField(lookup, name);
case NORMAL:
if (kind() == Code::KEYED_STORE_IC) break;
if (receiver->IsJSGlobalProxy() || receiver->IsGlobalObject()) {
@@ -1444,7 +1444,7 @@ Handle<Code> StoreIC::CompileHandler(LookupResult* lookup,
isolate(), info, receiver_type())) {
break;
}
- return compiler.CompileStoreCallback(receiver, holder, name, info);
+ return compiler.CompileStoreCallback(receiver, name, info);
} else if (callback->IsAccessorPair()) {
Handle<Object> setter(
Handle<AccessorPair>::cast(callback)->setter(), isolate());
@@ -1455,11 +1455,11 @@ Handle<Code> StoreIC::CompileHandler(LookupResult* lookup,
CallOptimization call_optimization(function);
if (call_optimization.is_simple_api_call() &&
call_optimization.IsCompatibleReceiver(receiver, holder)) {
- return compiler.CompileStoreCallback(
- receiver, holder, name, call_optimization);
+ return compiler.CompileStoreCallback(receiver, name,
+ call_optimization);
}
return compiler.CompileStoreViaSetter(
- receiver, holder, name, Handle<JSFunction>::cast(setter));
+ receiver, name, Handle<JSFunction>::cast(setter));
}
// TODO(dcarney): Handle correctly.
ASSERT(callback->IsDeclaredAccessorInfo());
@@ -1468,7 +1468,7 @@ Handle<Code> StoreIC::CompileHandler(LookupResult* lookup,
case INTERCEPTOR:
if (kind() == Code::KEYED_STORE_IC) break;
ASSERT(HasInterceptorSetter(*holder));
- return compiler.CompileStoreInterceptor(receiver, name);
+ return compiler.CompileStoreInterceptor(name);
case CONSTANT:
break;
case NONEXISTENT:
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698