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

Unified Diff: src/stub-cache.cc

Issue 8393003: Handlify simple functions of [keyed] store stub compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index 4c99c30e7fbb1c4f5e6c76528a75ce333f5ccaa5..ad7a6841ae81d106874c25c16acecb2881598181 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -417,20 +417,6 @@ Handle<Code> StubCache::ComputeKeyedLoadFunctionPrototype(
}
-Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object,
- int index,
- Handle<Map> transition,
- Handle<String> name) {
- CALL_HEAP_FUNCTION(
- isolate(),
- (set_failure(NULL),
- CompileStoreField(*object, index,
- transition.is_null() ? NULL : *transition,
- *name)),
- Code);
-}
-
-
Handle<Code> StubCache::ComputeStoreField(Handle<String> name,
Handle<JSObject> receiver,
int field_index,
@@ -452,14 +438,6 @@ Handle<Code> StubCache::ComputeStoreField(Handle<String> name,
}
-Handle<Code> KeyedStoreStubCompiler::CompileStoreElement(Handle<Map> map) {
- CALL_HEAP_FUNCTION(isolate(),
- (set_failure(NULL),
- CompileStoreElement(*map)),
- Code);
-}
-
-
Handle<Code> StubCache::ComputeKeyedLoadOrStoreElement(
Handle<JSObject> receiver,
KeyedIC::StubKind stub_kind,
@@ -515,29 +493,6 @@ Handle<Code> StubCache::ComputeKeyedLoadOrStoreElement(
}
-Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
- MapHandleList* receiver_maps,
- CodeHandleList* handler_stubs,
- MapHandleList* transitioned_maps) {
- MapList raw_receiver_maps(receiver_maps->length());
- CodeList raw_handler_stubs(handler_stubs->length());
- MapList raw_transitioned_maps(transitioned_maps->length());
- CALL_HEAP_FUNCTION(
- isolate(),
- (set_failure(NULL),
- raw_receiver_maps.Clear(),
- raw_handler_stubs.Clear(),
- raw_transitioned_maps.Clear(),
- CompileStorePolymorphic(UnwrapHandleList(&raw_receiver_maps,
- receiver_maps),
- UnwrapHandleList(&raw_handler_stubs,
- handler_stubs),
- UnwrapHandleList(&raw_transitioned_maps,
- transitioned_maps))),
- Code);
-}
-
-
Handle<Code> StubCache::ComputeStoreNormal(StrictModeFlag strict_mode) {
return (strict_mode == kStrictMode)
? isolate_->builtins()->Builtins::StoreIC_Normal_Strict()
@@ -545,17 +500,6 @@ Handle<Code> StubCache::ComputeStoreNormal(StrictModeFlag strict_mode) {
}
-Handle<Code> StoreStubCompiler::CompileStoreGlobal(
- Handle<GlobalObject> object,
- Handle<JSGlobalPropertyCell> holder,
- Handle<String> name) {
- CALL_HEAP_FUNCTION(isolate(),
- (set_failure(NULL),
- CompileStoreGlobal(*object, *holder, *name)),
- Code);
-}
-
-
Handle<Code> StubCache::ComputeStoreGlobal(Handle<String> name,
Handle<GlobalObject> receiver,
Handle<JSGlobalPropertyCell> cell,
@@ -629,19 +573,6 @@ Handle<Code> StubCache::ComputeStoreInterceptor(Handle<String> name,
return code;
}
-Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object,
- int index,
- Handle<Map> transition,
- Handle<String> name) {
- CALL_HEAP_FUNCTION(
- isolate(),
- (set_failure(NULL),
- CompileStoreField(*object, index,
- transition.is_null() ? NULL : *transition,
- *name)),
- Code);
-}
-
Handle<Code> StubCache::ComputeKeyedStoreField(Handle<String> name,
Handle<JSObject> receiver,
int field_index,
@@ -1616,7 +1547,20 @@ MaybeObject* KeyedLoadStubCompiler::TryGetCode(PropertyType type,
}
-MaybeObject* StoreStubCompiler::GetCode(PropertyType type, String* name) {
+Handle<Code> StoreStubCompiler::GetCode(PropertyType type,
+ Handle<String> name) {
+ Code::Flags flags =
+ Code::ComputeMonomorphicFlags(Code::STORE_IC, type, strict_mode_);
+ Handle<Code> code = GetCodeWithFlags(flags, name);
+ PROFILE(isolate(), CodeCreateEvent(Logger::STORE_IC_TAG, *code, *name));
+ GDBJIT(AddCode(GDBJITInterface::STORE_IC, *name, *code));
+ return code;
+}
+
+
+// TODO(ulan): Eliminate this function when the stub cache is fully
+// handlified.
+MaybeObject* StoreStubCompiler::TryGetCode(PropertyType type, String* name) {
Code::Flags flags =
Code::ComputeMonomorphicFlags(Code::STORE_IC, type, strict_mode_);
MaybeObject* result = TryGetCodeWithFlags(flags, name);
@@ -1633,22 +1577,15 @@ MaybeObject* StoreStubCompiler::GetCode(PropertyType type, String* name) {
}
-MaybeObject* KeyedStoreStubCompiler::GetCode(PropertyType type,
- String* name,
+Handle<Code> KeyedStoreStubCompiler::GetCode(PropertyType type,
+ Handle<String> name,
InlineCacheState state) {
Code::Flags flags =
Code::ComputeFlags(Code::KEYED_STORE_IC, state, strict_mode_, type);
- MaybeObject* result = TryGetCodeWithFlags(flags, name);
- if (!result->IsFailure()) {
- PROFILE(isolate(),
- CodeCreateEvent(Logger::KEYED_STORE_IC_TAG,
- Code::cast(result->ToObjectUnchecked()),
- name));
- GDBJIT(AddCode(GDBJITInterface::KEYED_STORE_IC,
- name,
- Code::cast(result->ToObjectUnchecked())));
- }
- return result;
+ Handle<Code> code = GetCodeWithFlags(flags, name);
+ PROFILE(isolate(), CodeCreateEvent(Logger::KEYED_STORE_IC_TAG, *code, *name));
+ GDBJIT(AddCode(GDBJITInterface::KEYED_STORE_IC, *name, *code));
+ return code;
}
« src/list-inl.h ('K') | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698