Revision: 22939
Author: [email protected]
Date: Wed Aug 6 15:05:28 2014 UTC
Log: Only allocate a handler compiler when necessary
BUG=
[email protected]
Review URL: https://codereview.chromium.org/443993002
http://code.google.com/p/v8/source/detail?r=22939
Modified:
/branches/bleeding_edge/src/ic.cc
=======================================
--- /branches/bleeding_edge/src/ic.cc Wed Aug 6 13:18:36 2014 UTC
+++ /branches/bleeding_edge/src/ic.cc Wed Aug 6 15:05:28 2014 UTC
@@ -998,12 +998,11 @@
Handle<HeapType> type = receiver_type();
Handle<JSObject> holder = lookup->GetHolder<JSObject>();
bool receiver_is_holder = object.is_identical_to(holder);
- NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
- cache_holder);
-
// -------------- Interceptors --------------
if (lookup->state() == LookupIterator::INTERCEPTOR) {
DCHECK(!holder->GetNamedInterceptor()->getter()->IsUndefined());
+ NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
+ cache_holder);
return compiler.CompileLoadInterceptor(name);
}
DCHECK(lookup->state() == LookupIterator::PROPERTY);
@@ -1033,6 +1032,8 @@
return slow_stub();
}
if (!holder->HasFastProperties()) return slow_stub();
+ NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
+ cache_holder);
return compiler.CompileLoadCallback(name, info);
}
if (accessors->IsAccessorPair()) {
@@ -1048,6 +1049,8 @@
return slow_stub();
}
CallOptimization call_optimization(function);
+ NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
+ cache_holder);
if (call_optimization.is_simple_api_call() &&
call_optimization.IsCompatibleReceiver(object, holder)) {
return compiler.CompileLoadCallback(name, call_optimization);
@@ -1064,6 +1067,8 @@
if (lookup->property_encoding() == LookupIterator::DICTIONARY) {
if (kind() != Code::LOAD_IC) return slow_stub();
if (holder->IsGlobalObject()) {
+ NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
+ cache_holder);
Handle<PropertyCell> cell = lookup->GetPropertyCell();
Handle<Code> code =
compiler.CompileLoadGlobal(cell, name, lookup->IsConfigurable());
@@ -1089,6 +1094,8 @@
if (receiver_is_holder) {
return SimpleFieldLoad(field);
}
+ NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
+ cache_holder);
return compiler.CompileLoadField(name, field);
}
@@ -1098,6 +1105,8 @@
LoadConstantStub stub(isolate(), lookup->GetConstantIndex());
return stub.GetCode();
}
+ NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
+ cache_holder);
return compiler.CompileLoadConstant(name, lookup->GetConstantIndex());
}
@@ -1459,7 +1468,6 @@
Handle<JSObject> receiver = Handle<JSObject>::cast(object);
Handle<JSObject> holder(lookup->holder());
- NamedStoreHandlerCompiler compiler(isolate(), receiver_type(), holder);
if (lookup->IsTransition()) {
// Explicitly pass in the receiver map since LookupForWrite may have
@@ -1469,6 +1477,7 @@
if (details.type() != CALLBACKS && details.attributes() == NONE &&
holder->HasFastProperties()) {
+ NamedStoreHandlerCompiler compiler(isolate(), receiver_type(),
holder);
return compiler.CompileStoreTransition(transition, name);
}
} else {
@@ -1486,6 +1495,7 @@
lookup->representation());
return stub.GetCode();
}
+ NamedStoreHandlerCompiler compiler(isolate(), receiver_type(),
holder);
return compiler.CompileStoreField(lookup, name);
}
case NORMAL:
@@ -1521,6 +1531,8 @@
isolate(), info, receiver_type())) {
break;
}
+ NamedStoreHandlerCompiler compiler(isolate(), receiver_type(),
+ holder);
return compiler.CompileStoreCallback(receiver, name, info);
} else if (callback->IsAccessorPair()) {
Handle<Object> setter(
@@ -1530,6 +1542,8 @@
if (!holder->HasFastProperties()) break;
Handle<JSFunction> function = Handle<JSFunction>::cast(setter);
CallOptimization call_optimization(function);
+ NamedStoreHandlerCompiler compiler(isolate(), receiver_type(),
+ holder);
if (call_optimization.is_simple_api_call() &&
call_optimization.IsCompatibleReceiver(receiver, holder)) {
return compiler.CompileStoreCallback(receiver, name,
@@ -1542,9 +1556,11 @@
DCHECK(callback->IsDeclaredAccessorInfo());
break;
}
- case INTERCEPTOR:
+ case INTERCEPTOR: {
DCHECK(HasInterceptorSetter(*holder));
+ NamedStoreHandlerCompiler compiler(isolate(), receiver_type(),
holder);
return compiler.CompileStoreInterceptor(name);
+ }
case CONSTANT:
break;
case NONEXISTENT:
--
--
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/d/optout.