Commit 0a099371 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Remove all compilation related interface from the StubCache

BUG=
R=ishell@chromium.org

Review URL: https://codereview.chromium.org/422853003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22678 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 57c315d0
......@@ -619,11 +619,11 @@ static void PushInterceptorArguments(MacroAssembler* masm,
Register holder,
Register name,
Handle<JSObject> holder_obj) {
STATIC_ASSERT(StubCache::kInterceptorArgsNameIndex == 0);
STATIC_ASSERT(StubCache::kInterceptorArgsInfoIndex == 1);
STATIC_ASSERT(StubCache::kInterceptorArgsThisIndex == 2);
STATIC_ASSERT(StubCache::kInterceptorArgsHolderIndex == 3);
STATIC_ASSERT(StubCache::kInterceptorArgsLength == 4);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsInfoIndex == 1);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 2);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 3);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 4);
__ push(name);
Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
......@@ -643,9 +643,8 @@ static void CompileCallLoadPropertyWithInterceptor(
Handle<JSObject> holder_obj,
IC::UtilityId id) {
PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
__ CallExternalReference(
ExternalReference(IC_Utility(id), masm->isolate()),
StubCache::kInterceptorArgsLength);
__ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
NamedLoadHandlerCompiler::kInterceptorArgsLength);
}
......@@ -1053,7 +1052,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
ExternalReference ref =
ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptor),
isolate());
__ TailCallExternalReference(ref, StubCache::kInterceptorArgsLength, 1);
__ TailCallExternalReference(
ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
}
}
......
......@@ -567,11 +567,11 @@ static void PushInterceptorArguments(MacroAssembler* masm,
Register holder,
Register name,
Handle<JSObject> holder_obj) {
STATIC_ASSERT(StubCache::kInterceptorArgsNameIndex == 0);
STATIC_ASSERT(StubCache::kInterceptorArgsInfoIndex == 1);
STATIC_ASSERT(StubCache::kInterceptorArgsThisIndex == 2);
STATIC_ASSERT(StubCache::kInterceptorArgsHolderIndex == 3);
STATIC_ASSERT(StubCache::kInterceptorArgsLength == 4);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsInfoIndex == 1);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 2);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 3);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 4);
__ Push(name);
Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
......@@ -591,9 +591,8 @@ static void CompileCallLoadPropertyWithInterceptor(
IC::UtilityId id) {
PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
__ CallExternalReference(
ExternalReference(IC_Utility(id), masm->isolate()),
StubCache::kInterceptorArgsLength);
__ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
NamedLoadHandlerCompiler::kInterceptorArgsLength);
}
......@@ -1015,7 +1014,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
ExternalReference ref =
ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptor),
isolate());
__ TailCallExternalReference(ref, StubCache::kInterceptorArgsLength, 1);
__ TailCallExternalReference(
ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
}
}
......
......@@ -264,11 +264,11 @@ static void PushInterceptorArguments(MacroAssembler* masm,
Register holder,
Register name,
Handle<JSObject> holder_obj) {
STATIC_ASSERT(StubCache::kInterceptorArgsNameIndex == 0);
STATIC_ASSERT(StubCache::kInterceptorArgsInfoIndex == 1);
STATIC_ASSERT(StubCache::kInterceptorArgsThisIndex == 2);
STATIC_ASSERT(StubCache::kInterceptorArgsHolderIndex == 3);
STATIC_ASSERT(StubCache::kInterceptorArgsLength == 4);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsInfoIndex == 1);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 2);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 3);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 4);
__ push(name);
Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
......@@ -288,9 +288,8 @@ static void CompileCallLoadPropertyWithInterceptor(
Handle<JSObject> holder_obj,
IC::UtilityId id) {
PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
__ CallExternalReference(
ExternalReference(IC_Utility(id), masm->isolate()),
StubCache::kInterceptorArgsLength);
__ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
NamedLoadHandlerCompiler::kInterceptorArgsLength);
}
......@@ -1036,7 +1035,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
ExternalReference ref =
ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptor),
isolate());
__ TailCallExternalReference(ref, StubCache::kInterceptorArgsLength, 1);
__ TailCallExternalReference(
ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
}
}
......
......@@ -482,8 +482,8 @@ void LoadIC::Clear(Isolate* isolate,
Code* target,
ConstantPoolArray* constant_pool) {
if (IsCleared(target)) return;
Code* code = target->GetIsolate()->stub_cache()->FindPreMonomorphicIC(
Code::LOAD_IC, target->extra_ic_state());
Code* code = PropertyICCompiler::FindPreMonomorphicIC(
isolate, Code::LOAD_IC, target->extra_ic_state());
SetTargetAtAddress(address, code, constant_pool);
}
......@@ -493,8 +493,8 @@ void StoreIC::Clear(Isolate* isolate,
Code* target,
ConstantPoolArray* constant_pool) {
if (IsCleared(target)) return;
Code* code = target->GetIsolate()->stub_cache()->FindPreMonomorphicIC(
Code::STORE_IC, target->extra_ic_state());
Code* code = PropertyICCompiler::FindPreMonomorphicIC(
isolate, Code::STORE_IC, target->extra_ic_state());
SetTargetAtAddress(address, code, constant_pool);
}
......@@ -660,7 +660,7 @@ bool IC::UpdatePolymorphicIC(Handle<String> name, Handle<Code> code) {
if (number_of_valid_types > 1 && target()->is_keyed_stub()) return false;
Handle<Code> ic;
if (number_of_valid_types == 1) {
ic = isolate()->stub_cache()->ComputeMonomorphicIC(kind(), name, type, code,
ic = PropertyICCompiler::ComputeMonomorphicIC(kind(), name, type, code,
extra_ic_state());
} else {
if (handler_to_overwrite >= 0) {
......@@ -672,8 +672,8 @@ bool IC::UpdatePolymorphicIC(Handle<String> name, Handle<Code> code) {
types.Add(type);
handlers.Add(code);
}
ic = isolate()->stub_cache()->ComputePolymorphicIC(
kind(), &types, &handlers, number_of_valid_types, name,
ic = PropertyICCompiler::ComputePolymorphicIC(kind(), &types, &handlers,
number_of_valid_types, name,
extra_ic_state());
}
set_target(*ic);
......@@ -725,7 +725,7 @@ Handle<HeapType> IC::MapToType<HeapType>(Handle<Map> map, Isolate* region);
void IC::UpdateMonomorphicIC(Handle<Code> handler, Handle<String> name) {
if (!handler->is_handler()) return set_target(*handler);
Handle<Code> ic = isolate()->stub_cache()->ComputeMonomorphicIC(
Handle<Code> ic = PropertyICCompiler::ComputeMonomorphicIC(
kind(), name, receiver_type(), handler, extra_ic_state());
set_target(*ic);
}
......@@ -786,13 +786,14 @@ void IC::PatchCache(Handle<String> name, Handle<Code> code) {
Handle<Code> LoadIC::initialize_stub(Isolate* isolate,
ExtraICState extra_state) {
return isolate->stub_cache()->ComputeLoad(UNINITIALIZED, extra_state);
return PropertyICCompiler::ComputeLoad(isolate, UNINITIALIZED, extra_state);
}
Handle<Code> LoadIC::megamorphic_stub() {
if (kind() == Code::LOAD_IC) {
return isolate()->stub_cache()->ComputeLoad(MEGAMORPHIC, extra_ic_state());
return PropertyICCompiler::ComputeLoad(isolate(), MEGAMORPHIC,
extra_ic_state());
} else {
ASSERT_EQ(Code::KEYED_LOAD_IC, kind());
return KeyedLoadIC::generic_stub(isolate());
......@@ -802,7 +803,7 @@ Handle<Code> LoadIC::megamorphic_stub() {
Handle<Code> LoadIC::pre_monomorphic_stub(Isolate* isolate,
ExtraICState extra_state) {
return isolate->stub_cache()->ComputeLoad(PREMONOMORPHIC, extra_state);
return PropertyICCompiler::ComputeLoad(isolate, PREMONOMORPHIC, extra_state);
}
......@@ -845,7 +846,7 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
code = slow_stub();
} else if (!lookup->IsProperty()) {
if (kind() == Code::LOAD_IC) {
code = isolate()->stub_cache()->ComputeLoadNonexistent(name,
code = NamedLoadHandlerCompiler::ComputeLoadNonexistent(name,
receiver_type());
// TODO(jkummerow/verwaest): Introduce a builtin that handles this case.
if (code.is_null()) code = slow_stub();
......@@ -1072,7 +1073,7 @@ Handle<Code> KeyedLoadIC::LoadElementStub(Handle<JSObject> receiver) {
TargetMaps(&target_receiver_maps);
}
if (target_receiver_maps.length() == 0) {
return isolate()->stub_cache()->ComputeKeyedLoadElement(receiver_map);
return PropertyICCompiler::ComputeKeyedLoadElement(receiver_map);
}
// The first time a receiver is seen that is a transitioned version of the
......@@ -1086,7 +1087,7 @@ Handle<Code> KeyedLoadIC::LoadElementStub(Handle<JSObject> receiver) {
IsMoreGeneralElementsKindTransition(
target_receiver_maps.at(0)->elements_kind(),
receiver->GetElementsKind())) {
return isolate()->stub_cache()->ComputeKeyedLoadElement(receiver_map);
return PropertyICCompiler::ComputeKeyedLoadElement(receiver_map);
}
ASSERT(state() != GENERIC);
......@@ -1107,7 +1108,7 @@ Handle<Code> KeyedLoadIC::LoadElementStub(Handle<JSObject> receiver) {
return generic_stub();
}
return isolate()->stub_cache()->ComputeLoadElementPolymorphic(
return PropertyICCompiler::ComputeLoadElementPolymorphic(
&target_receiver_maps);
}
......@@ -1341,26 +1342,27 @@ Handle<Code> CallIC::initialize_stub(Isolate* isolate,
Handle<Code> StoreIC::initialize_stub(Isolate* isolate,
StrictMode strict_mode) {
ExtraICState extra_state = ComputeExtraICState(strict_mode);
Handle<Code> ic = isolate->stub_cache()->ComputeStore(
UNINITIALIZED, extra_state);
Handle<Code> ic =
PropertyICCompiler::ComputeStore(isolate, UNINITIALIZED, extra_state);
return ic;
}
Handle<Code> StoreIC::megamorphic_stub() {
return isolate()->stub_cache()->ComputeStore(MEGAMORPHIC, extra_ic_state());
return PropertyICCompiler::ComputeStore(isolate(), MEGAMORPHIC,
extra_ic_state());
}
Handle<Code> StoreIC::generic_stub() const {
return isolate()->stub_cache()->ComputeStore(GENERIC, extra_ic_state());
return PropertyICCompiler::ComputeStore(isolate(), GENERIC, extra_ic_state());
}
Handle<Code> StoreIC::pre_monomorphic_stub(Isolate* isolate,
StrictMode strict_mode) {
ExtraICState state = ComputeExtraICState(strict_mode);
return isolate->stub_cache()->ComputeStore(PREMONOMORPHIC, state);
return PropertyICCompiler::ComputeStore(isolate, PREMONOMORPHIC, state);
}
......@@ -1492,7 +1494,7 @@ Handle<Code> KeyedStoreIC::StoreElementStub(Handle<JSObject> receiver,
Handle<Map> monomorphic_map =
ComputeTransitionedMap(receiver_map, store_mode);
store_mode = GetNonTransitioningStoreMode(store_mode);
return isolate()->stub_cache()->ComputeKeyedStoreElement(
return PropertyICCompiler::ComputeKeyedStoreElement(
monomorphic_map, strict_mode(), store_mode);
}
......@@ -1517,7 +1519,7 @@ Handle<Code> KeyedStoreIC::StoreElementStub(Handle<JSObject> receiver,
// if they at least come from the same origin for a transitioning store,
// stay MONOMORPHIC and use the map for the most generic ElementsKind.
store_mode = GetNonTransitioningStoreMode(store_mode);
return isolate()->stub_cache()->ComputeKeyedStoreElement(
return PropertyICCompiler::ComputeKeyedStoreElement(
transitioned_receiver_map, strict_mode(), store_mode);
} else if (*previous_receiver_map == receiver->map() &&
old_store_mode == STANDARD_STORE &&
......@@ -1527,7 +1529,7 @@ Handle<Code> KeyedStoreIC::StoreElementStub(Handle<JSObject> receiver,
// A "normal" IC that handles stores can switch to a version that can
// grow at the end of the array, handle OOB accesses or copy COW arrays
// and still stay MONOMORPHIC.
return isolate()->stub_cache()->ComputeKeyedStoreElement(
return PropertyICCompiler::ComputeKeyedStoreElement(
receiver_map, strict_mode(), store_mode);
}
}
......@@ -1589,7 +1591,7 @@ Handle<Code> KeyedStoreIC::StoreElementStub(Handle<JSObject> receiver,
}
}
return isolate()->stub_cache()->ComputeStoreElementPolymorphic(
return PropertyICCompiler::ComputeStoreElementPolymorphic(
&target_receiver_maps, store_mode, strict_mode());
}
......@@ -2955,7 +2957,7 @@ Handle<Object> CompareNilIC::CompareNil(Handle<Object> object) {
Handle<Map> monomorphic_map(already_monomorphic && FirstTargetMap() != NULL
? FirstTargetMap()
: HeapObject::cast(*object)->map());
code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, &stub);
code = PropertyICCompiler::ComputeCompareNil(monomorphic_map, &stub);
} else {
code = stub.GetCode();
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -232,11 +232,11 @@ static void PushInterceptorArguments(MacroAssembler* masm,
Register holder,
Register name,
Handle<JSObject> holder_obj) {
STATIC_ASSERT(StubCache::kInterceptorArgsNameIndex == 0);
STATIC_ASSERT(StubCache::kInterceptorArgsInfoIndex == 1);
STATIC_ASSERT(StubCache::kInterceptorArgsThisIndex == 2);
STATIC_ASSERT(StubCache::kInterceptorArgsHolderIndex == 3);
STATIC_ASSERT(StubCache::kInterceptorArgsLength == 4);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsInfoIndex == 1);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 2);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 3);
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 4);
__ Push(name);
Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
......@@ -255,9 +255,8 @@ static void CompileCallLoadPropertyWithInterceptor(
Handle<JSObject> holder_obj,
IC::UtilityId id) {
PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
__ CallExternalReference(
ExternalReference(IC_Utility(id), masm->isolate()),
StubCache::kInterceptorArgsLength);
__ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
NamedLoadHandlerCompiler::kInterceptorArgsLength);
}
......@@ -959,7 +958,8 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(
ExternalReference ref = ExternalReference(
IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
__ TailCallExternalReference(ref, StubCache::kInterceptorArgsLength, 1);
__ TailCallExternalReference(
ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment