Commit abeb5a4d authored by ulan@chromium.org's avatar ulan@chromium.org

Handlify simple functions of [keyed] load stub compiler.

Handlified functions: CompileLoadNonexistent, CompileLoadField,
CompileLoadConstant, CompileLoadArrayLength, CompileLoadStringLength,
CompileLoadFunctionPrototype.

R=kmillikin@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8383033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9773 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b8af2786
This diff is collapsed.
This diff is collapsed.
......@@ -109,16 +109,6 @@ Code* StubCache::Set(String* name, Map* map, Code* code) {
}
Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name,
Handle<JSObject> object,
Handle<JSObject> last) {
CALL_HEAP_FUNCTION(isolate(),
(set_failure(NULL),
CompileLoadNonexistent(*name, *object, *last)),
Code);
}
Handle<Code> StubCache::ComputeLoadNonexistent(Handle<String> name,
Handle<JSObject> receiver) {
ASSERT(receiver->IsGlobalObject() || receiver->HasFastProperties());
......@@ -152,17 +142,6 @@ Handle<Code> StubCache::ComputeLoadNonexistent(Handle<String> name,
}
Handle<Code> LoadStubCompiler::CompileLoadField(Handle<JSObject> object,
Handle<JSObject> holder,
int index,
Handle<String> name) {
CALL_HEAP_FUNCTION(isolate(),
(set_failure(NULL),
CompileLoadField(*object, *holder, index, *name)),
Code);
}
Handle<Code> StubCache::ComputeLoadField(Handle<String> name,
Handle<JSObject> receiver,
Handle<JSObject> holder,
......@@ -214,17 +193,6 @@ Handle<Code> StubCache::ComputeLoadCallback(Handle<String> name,
}
Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object,
Handle<JSObject> holder,
Handle<Object> value,
Handle<String> name) {
CALL_HEAP_FUNCTION(isolate(),
(set_failure(NULL),
CompileLoadConstant(*object, *holder, *value, *name)),
Code);
}
Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name,
Handle<JSObject> receiver,
Handle<JSObject> holder,
......@@ -277,6 +245,7 @@ Handle<Code> StubCache::ComputeLoadNormal() {
return isolate_->builtins()->LoadIC_Normal();
}
Handle<Code> LoadStubCompiler::CompileLoadGlobal(
Handle<JSObject> object,
Handle<GlobalObject> holder,
......@@ -289,6 +258,8 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
*object, *holder, *cell, *name, is_dont_delete)),
Code);
}
Handle<Code> StubCache::ComputeLoadGlobal(Handle<String> name,
Handle<JSObject> receiver,
Handle<GlobalObject> holder,
......@@ -309,17 +280,6 @@ Handle<Code> StubCache::ComputeLoadGlobal(Handle<String> name,
}
Handle<Code> KeyedLoadStubCompiler::CompileLoadField(Handle<String> name,
Handle<JSObject> object,
Handle<JSObject> holder,
int index) {
CALL_HEAP_FUNCTION(isolate(),
(set_failure(NULL),
CompileLoadField(*name, *object, *holder, index)),
Code);
}
Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name,
Handle<JSObject> receiver,
Handle<JSObject> holder,
......@@ -339,17 +299,6 @@ Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name,
}
Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant(Handle<String> name,
Handle<JSObject> object,
Handle<JSObject> holder,
Handle<Object> value) {
CALL_HEAP_FUNCTION(isolate(),
(set_failure(NULL),
CompileLoadConstant(*name, *object, *holder, *value)),
Code);
}
Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<String> name,
Handle<JSObject> receiver,
Handle<JSObject> holder,
......@@ -432,14 +381,6 @@ Handle<Code> StubCache::ComputeKeyedLoadCallback(
}
Handle<Code> KeyedLoadStubCompiler::CompileLoadArrayLength(
Handle<String> name) {
CALL_HEAP_FUNCTION(isolate(),
(set_failure(NULL),
CompileLoadArrayLength(*name)),
Code);
}
Handle<Code> StubCache::ComputeKeyedLoadArrayLength(Handle<String> name,
Handle<JSArray> receiver) {
Code::Flags flags =
......@@ -456,14 +397,6 @@ Handle<Code> StubCache::ComputeKeyedLoadArrayLength(Handle<String> name,
}
Handle<Code> KeyedLoadStubCompiler::CompileLoadStringLength(
Handle<String> name) {
CALL_HEAP_FUNCTION(isolate(),
(set_failure(NULL),
CompileLoadStringLength(*name)),
Code);
}
Handle<Code> StubCache::ComputeKeyedLoadStringLength(Handle<String> name,
Handle<String> receiver) {
Code::Flags flags =
......@@ -481,15 +414,6 @@ Handle<Code> StubCache::ComputeKeyedLoadStringLength(Handle<String> name,
}
Handle<Code> KeyedLoadStubCompiler::CompileLoadFunctionPrototype(
Handle<String> name) {
CALL_HEAP_FUNCTION(isolate(),
(set_failure(NULL),
CompileLoadFunctionPrototype(*name)),
Code);
}
Handle<Code> StubCache::ComputeKeyedLoadFunctionPrototype(
Handle<String> name,
Handle<JSFunction> receiver) {
......@@ -1672,8 +1596,18 @@ void StubCompiler::LookupPostInterceptor(JSObject* holder,
}
Handle<Code> LoadStubCompiler::GetCode(PropertyType type, Handle<String> name) {
Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type);
Handle<Code> code = GetCodeWithFlags(flags, name);
PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
return code;
}
MaybeObject* LoadStubCompiler::GetCode(PropertyType type, String* name) {
// TODO(ulan): Eliminate this function when the stub cache is fully
// handlified.
MaybeObject* LoadStubCompiler::TryGetCode(PropertyType type, String* name) {
Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type);
MaybeObject* result = TryGetCodeWithFlags(flags, name);
if (!result->IsFailure()) {
......@@ -1689,7 +1623,20 @@ MaybeObject* LoadStubCompiler::GetCode(PropertyType type, String* name) {
}
MaybeObject* KeyedLoadStubCompiler::GetCode(PropertyType type,
Handle<Code> KeyedLoadStubCompiler::GetCode(PropertyType type,
Handle<String> name,
InlineCacheState state) {
Code::Flags flags = Code::ComputeFlags(
Code::KEYED_LOAD_IC, state, Code::kNoExtraICState, type);
Handle<Code> code = GetCodeWithFlags(flags, name);
PROFILE(isolate(), CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
return code;
}
// TODO(ulan): Eliminate this function when the stub cache is fully
// handlified.
MaybeObject* KeyedLoadStubCompiler::TryGetCode(PropertyType type,
String* name,
InlineCacheState state) {
Code::Flags flags = Code::ComputeFlags(
......
......@@ -528,14 +528,14 @@ class StubCompiler BASE_EMBEDDED {
MacroAssembler* masm() { return &masm_; }
void set_failure(Failure* failure) { failure_ = failure; }
void GenerateLoadField(JSObject* object,
JSObject* holder,
void GenerateLoadField(Handle<JSObject> object,
Handle<JSObject> holder,
Register receiver,
Register scratch1,
Register scratch2,
Register scratch3,
int index,
String* name,
Handle<String> name,
Label* miss);
MaybeObject* GenerateLoadCallback(JSObject* object,
......@@ -549,14 +549,14 @@ class StubCompiler BASE_EMBEDDED {
String* name,
Label* miss);
void GenerateLoadConstant(JSObject* object,
JSObject* holder,
void GenerateLoadConstant(Handle<JSObject> object,
Handle<JSObject> holder,
Register receiver,
Register scratch1,
Register scratch2,
Register scratch3,
Object* value,
String* name,
Handle<Object> value,
Handle<String> name,
Label* miss);
void GenerateLoadInterceptor(JSObject* object,
......@@ -593,20 +593,11 @@ class LoadStubCompiler: public StubCompiler {
Handle<JSObject> object,
Handle<JSObject> last);
MUST_USE_RESULT MaybeObject* CompileLoadNonexistent(String* name,
JSObject* object,
JSObject* last);
Handle<Code> CompileLoadField(Handle<JSObject> object,
Handle<JSObject> holder,
int index,
Handle<String> name);
MUST_USE_RESULT MaybeObject* CompileLoadField(JSObject* object,
JSObject* holder,
int index,
String* name);
Handle<Code> CompileLoadCallback(Handle<String> name,
Handle<JSObject> object,
Handle<JSObject> holder,
......@@ -622,11 +613,6 @@ class LoadStubCompiler: public StubCompiler {
Handle<Object> value,
Handle<String> name);
MUST_USE_RESULT MaybeObject* CompileLoadConstant(JSObject* object,
JSObject* holder,
Object* value,
String* name);
Handle<Code> CompileLoadInterceptor(Handle<JSObject> object,
Handle<JSObject> holder,
Handle<String> name);
......@@ -648,7 +634,9 @@ class LoadStubCompiler: public StubCompiler {
bool is_dont_delete);
private:
MUST_USE_RESULT MaybeObject* GetCode(PropertyType type, String* name);
MUST_USE_RESULT MaybeObject* TryGetCode(PropertyType type, String* name);
Handle<Code> GetCode(PropertyType type, Handle<String> name);
};
......@@ -661,11 +649,6 @@ class KeyedLoadStubCompiler: public StubCompiler {
Handle<JSObject> holder,
int index);
MUST_USE_RESULT MaybeObject* CompileLoadField(String* name,
JSObject* object,
JSObject* holder,
int index);
Handle<Code> CompileLoadCallback(Handle<String> name,
Handle<JSObject> object,
Handle<JSObject> holder,
......@@ -681,11 +664,6 @@ class KeyedLoadStubCompiler: public StubCompiler {
Handle<JSObject> holder,
Handle<Object> value);
MUST_USE_RESULT MaybeObject* CompileLoadConstant(String* name,
JSObject* object,
JSObject* holder,
Object* value);
Handle<Code> CompileLoadInterceptor(Handle<JSObject> object,
Handle<JSObject> holder,
Handle<String> name);
......@@ -696,16 +674,10 @@ class KeyedLoadStubCompiler: public StubCompiler {
Handle<Code> CompileLoadArrayLength(Handle<String> name);
MUST_USE_RESULT MaybeObject* CompileLoadArrayLength(String* name);
Handle<Code> CompileLoadStringLength(Handle<String> name);
MUST_USE_RESULT MaybeObject* CompileLoadStringLength(String* name);
Handle<Code> CompileLoadFunctionPrototype(Handle<String> name);
MUST_USE_RESULT MaybeObject* CompileLoadFunctionPrototype(String* name);
Handle<Code> CompileLoadElement(Handle<Map> receiver_map);
MUST_USE_RESULT MaybeObject* CompileLoadElement(Map* receiver_map);
......@@ -727,9 +699,13 @@ class KeyedLoadStubCompiler: public StubCompiler {
static void GenerateLoadDictionaryElement(MacroAssembler* masm);
private:
MaybeObject* GetCode(PropertyType type,
MaybeObject* TryGetCode(PropertyType type,
String* name,
InlineCacheState state = MONOMORPHIC);
Handle<Code> GetCode(PropertyType type,
Handle<String> name,
InlineCacheState state = MONOMORPHIC);
};
......
This diff is collapsed.
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