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

Handlify upper layers of KeyedLoadIC.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9714 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 655b2332
This diff is collapsed.
......@@ -356,12 +356,17 @@ class KeyedIC: public IC {
ElementsKind elements_kind) = 0;
protected:
virtual Code* string_stub() {
return NULL;
virtual Handle<Code> string_stub() {
return Handle<Code>::null();
}
virtual Code::Kind kind() const = 0;
Handle<Code> ComputeStub(Handle<JSObject> receiver,
StubKind stub_kind,
StrictModeFlag strict_mode,
Handle<Code> default_stub);
MaybeObject* ComputeStub(JSObject* receiver,
StubKind stub_kind,
StrictModeFlag strict_mode,
......@@ -433,9 +438,8 @@ class KeyedLoadIC: public KeyedIC {
MapList* receiver_maps,
StrictModeFlag strict_mode);
virtual Code* string_stub() {
return isolate()->builtins()->builtin(
Builtins::kKeyedLoadIC_String);
virtual Handle<Code> string_stub() {
return isolate()->builtins()->KeyedLoadIC_String();
}
private:
......@@ -450,25 +454,20 @@ class KeyedLoadIC: public KeyedIC {
return Isolate::Current()->builtins()->builtin(
Builtins::kKeyedLoadIC_Initialize);
}
Code* megamorphic_stub() {
return isolate()->builtins()->builtin(
Builtins::kKeyedLoadIC_Generic);
Handle<Code> megamorphic_stub() {
return isolate()->builtins()->KeyedLoadIC_Generic();
}
Code* generic_stub() {
return isolate()->builtins()->builtin(
Builtins::kKeyedLoadIC_Generic);
Handle<Code> generic_stub() {
return isolate()->builtins()->KeyedLoadIC_Generic();
}
Code* pre_monomorphic_stub() {
return isolate()->builtins()->builtin(
Builtins::kKeyedLoadIC_PreMonomorphic);
Handle<Code> pre_monomorphic_stub() {
return isolate()->builtins()->KeyedLoadIC_PreMonomorphic();
}
Code* indexed_interceptor_stub() {
return isolate()->builtins()->builtin(
Builtins::kKeyedLoadIC_IndexedInterceptor);
Handle<Code> indexed_interceptor_stub() {
return isolate()->builtins()->KeyedLoadIC_IndexedInterceptor();
}
Code* non_strict_arguments_stub() {
return isolate()->builtins()->builtin(
Builtins::kKeyedLoadIC_NonStrictArguments);
Handle<Code> non_strict_arguments_stub() {
return isolate()->builtins()->KeyedLoadIC_NonStrictArguments();
}
static void Clear(Address address, Code* target);
......
......@@ -4655,6 +4655,13 @@ MaybeObject* Map::CopyDropTransitions() {
return new_map;
}
void Map::UpdateCodeCache(Handle<Map> map,
Handle<String> name,
Handle<Code> code) {
Isolate* isolate = map->GetIsolate();
CALL_HEAP_FUNCTION_VOID(isolate,
map->UpdateCodeCache(*name, *code));
}
MaybeObject* Map::UpdateCodeCache(String* name, Code* code) {
// Allocate the code cache if not present.
......
......@@ -4258,6 +4258,9 @@ class Map: public HeapObject {
inline void ClearCodeCache(Heap* heap);
// Update code cache.
static void UpdateCodeCache(Handle<Map> map,
Handle<String> name,
Handle<Code> code);
MUST_USE_RESULT MaybeObject* UpdateCodeCache(String* name, Code* code);
// Returns the found code or undefined if absent.
......
This diff is collapsed.
......@@ -108,39 +108,33 @@ class StubCache {
// ---
MUST_USE_RESULT MaybeObject* ComputeKeyedLoadField(String* name,
JSObject* receiver,
JSObject* holder,
int field_index);
Handle<Code> ComputeKeyedLoadField(Handle<String> name,
Handle<JSObject> receiver,
Handle<JSObject> holder,
int field_index);
MUST_USE_RESULT MaybeObject* ComputeKeyedLoadCallback(
String* name,
JSObject* receiver,
JSObject* holder,
AccessorInfo* callback);
Handle<Code> ComputeKeyedLoadCallback(Handle<String> name,
Handle<JSObject> receiver,
Handle<JSObject> holder,
Handle<AccessorInfo> callback);
MUST_USE_RESULT MaybeObject* ComputeKeyedLoadConstant(
String* name,
JSObject* receiver,
JSObject* holder,
Object* value);
Handle<Code> ComputeKeyedLoadConstant(Handle<String> name,
Handle<JSObject> receiver,
Handle<JSObject> holder,
Handle<Object> value);
MUST_USE_RESULT MaybeObject* ComputeKeyedLoadInterceptor(
String* name,
JSObject* receiver,
JSObject* holder);
Handle<Code> ComputeKeyedLoadInterceptor(Handle<String> name,
Handle<JSObject> receiver,
Handle<JSObject> holder);
MUST_USE_RESULT MaybeObject* ComputeKeyedLoadArrayLength(
String* name,
JSArray* receiver);
Handle<Code> ComputeKeyedLoadArrayLength(Handle<String> name,
Handle<JSArray> receiver);
MUST_USE_RESULT MaybeObject* ComputeKeyedLoadStringLength(
String* name,
String* receiver);
Handle<Code> ComputeKeyedLoadStringLength(Handle<String> name,
Handle<String> receiver);
MUST_USE_RESULT MaybeObject* ComputeKeyedLoadFunctionPrototype(
String* name,
JSFunction* receiver);
Handle<Code> ComputeKeyedLoadFunctionPrototype(Handle<String> name,
Handle<JSFunction> receiver);
// ---
......@@ -638,27 +632,55 @@ class LoadStubCompiler: public StubCompiler {
class KeyedLoadStubCompiler: public StubCompiler {
public:
explicit KeyedLoadStubCompiler(Isolate* isolate) : StubCompiler(isolate) { }
Handle<Code> CompileLoadField(Handle<String> name,
Handle<JSObject> object,
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,
Handle<AccessorInfo> callback);
MUST_USE_RESULT MaybeObject* CompileLoadCallback(String* name,
JSObject* object,
JSObject* holder,
AccessorInfo* callback);
Handle<Code> CompileLoadConstant(Handle<String> name,
Handle<JSObject> object,
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);
MUST_USE_RESULT MaybeObject* CompileLoadInterceptor(JSObject* object,
JSObject* holder,
String* name);
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);
MUST_USE_RESULT MaybeObject* CompileLoadElement(Map* receiver_map);
......
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