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

Unified Diff: src/stub-cache.h

Issue 422023003: Encapsulate the holder in the PropertyHolderCompilers (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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
« no previous file with comments | « src/ic.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.h
diff --git a/src/stub-cache.h b/src/stub-cache.h
index f3a330b8a36f81236c86567beb1786395c436a1a..1a38361be37c421f8c0f6a6a84624391d7686739 100644
--- a/src/stub-cache.h
+++ b/src/stub-cache.h
@@ -374,21 +374,23 @@ class PropertyHandlerCompiler : public PropertyAccessCompiler {
protected:
PropertyHandlerCompiler(Isolate* isolate, Code::Kind kind,
- Handle<HeapType> type, CacheHolderFlag cache_holder)
- : PropertyAccessCompiler(isolate, kind, cache_holder), type_(type) {}
+ Handle<HeapType> type, Handle<JSObject> holder,
+ CacheHolderFlag cache_holder)
+ : PropertyAccessCompiler(isolate, kind, cache_holder),
+ type_(type),
+ holder_(holder) {}
virtual ~PropertyHandlerCompiler() {}
- virtual Register FrontendHeader(Register object_reg, Handle<JSObject> holder,
- Handle<Name> name, Label* miss) {
+ virtual Register FrontendHeader(Register object_reg, Handle<Name> name,
+ Label* miss) {
UNREACHABLE();
return receiver();
}
virtual void FrontendFooter(Handle<Name> name, Label* miss) { UNREACHABLE(); }
- Register Frontend(Register object_reg, Handle<JSObject> holder,
- Handle<Name> name);
+ Register Frontend(Register object_reg, Handle<Name> name);
// TODO(verwaest): Make non-static.
static void GenerateFastApiCall(MacroAssembler* masm,
@@ -430,53 +432,55 @@ class PropertyHandlerCompiler : public PropertyAccessCompiler {
// register is only clobbered if it the same as the holder register. The
// function returns a register containing the holder - either object_reg or
// holder_reg.
- Register CheckPrototypes(Register object_reg, Handle<JSObject> holder,
- Register holder_reg, Register scratch1,
- Register scratch2, Handle<Name> name, Label* miss,
+ Register CheckPrototypes(Register object_reg, Register holder_reg,
+ Register scratch1, Register scratch2,
+ Handle<Name> name, Label* miss,
PrototypeCheckType check = CHECK_ALL_MAPS);
Handle<Code> GetCode(Code::Kind kind, Code::StubType type, Handle<Name> name);
void set_type_for_object(Handle<Object> object) {
type_ = IC::CurrentTypeOf(object, isolate());
}
+ void set_holder(Handle<JSObject> holder) { holder_ = holder; }
Handle<HeapType> type() const { return type_; }
+ Handle<JSObject> holder() const { return holder_; }
private:
Handle<HeapType> type_;
+ Handle<JSObject> holder_;
};
class NamedLoadHandlerCompiler : public PropertyHandlerCompiler {
public:
NamedLoadHandlerCompiler(Isolate* isolate, Handle<HeapType> type,
+ Handle<JSObject> holder,
CacheHolderFlag cache_holder)
- : PropertyHandlerCompiler(isolate, Code::LOAD_IC, type, cache_holder) {}
+ : PropertyHandlerCompiler(isolate, Code::LOAD_IC, type, holder,
+ cache_holder) {}
virtual ~NamedLoadHandlerCompiler() {}
- Handle<Code> CompileLoadField(Handle<JSObject> holder, Handle<Name> name,
- FieldIndex index,
+ Handle<Code> CompileLoadField(Handle<Name> name, FieldIndex index,
Representation representation);
- Handle<Code> CompileLoadCallback(Handle<JSObject> holder, Handle<Name> name,
+ Handle<Code> CompileLoadCallback(Handle<Name> name,
Handle<ExecutableAccessorInfo> callback);
- Handle<Code> CompileLoadCallback(Handle<JSObject> holder, Handle<Name> name,
+ Handle<Code> CompileLoadCallback(Handle<Name> name,
const CallOptimization& call_optimization);
- Handle<Code> CompileLoadConstant(Handle<JSObject> holder, Handle<Name> name,
- Handle<Object> value);
+ Handle<Code> CompileLoadConstant(Handle<Name> name, Handle<Object> value);
- Handle<Code> CompileLoadInterceptor(Handle<JSObject> holder,
- Handle<Name> name);
+ Handle<Code> CompileLoadInterceptor(Handle<Name> name);
- Handle<Code> CompileLoadViaGetter(Handle<JSObject> holder, Handle<Name> name,
+ Handle<Code> CompileLoadViaGetter(Handle<Name> name,
Handle<JSFunction> getter);
- Handle<Code> CompileLoadGlobal(Handle<GlobalObject> holder,
- Handle<PropertyCell> cell, Handle<Name> name,
+ Handle<Code> CompileLoadGlobal(Handle<PropertyCell> cell, Handle<Name> name,
bool is_dont_delete);
+ // Static interface
static Handle<Code> ComputeLoadNonexistent(Handle<Name> name,
Handle<HeapType> type);
@@ -506,19 +510,18 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler {
static const int kInterceptorArgsLength = 4;
protected:
- virtual Register FrontendHeader(Register object_reg, Handle<JSObject> holder,
- Handle<Name> name, Label* miss);
+ virtual Register FrontendHeader(Register object_reg, Handle<Name> name,
+ Label* miss);
virtual void FrontendFooter(Handle<Name> name, Label* miss);
private:
- Register CallbackFrontend(Register object_reg, Handle<JSObject> holder,
- Handle<Name> name, Handle<Object> callback);
- Handle<Code> CompileLoadNonexistent(Handle<JSObject> last, Handle<Name> name);
- void NonexistentFrontend(Handle<JSObject> last, Handle<Name> name);
+ Register CallbackFrontend(Register object_reg, Handle<Name> name,
+ Handle<Object> callback);
+ Handle<Code> CompileLoadNonexistent(Handle<Name> name);
+ void NonexistentFrontend(Handle<Name> name);
void GenerateLoadField(Register reg,
- Handle<JSObject> holder,
FieldIndex field,
Representation representation);
void GenerateLoadConstant(Handle<Object> value);
@@ -527,11 +530,9 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler {
void GenerateLoadCallback(const CallOptimization& call_optimization,
Handle<Map> receiver_map);
void GenerateLoadInterceptor(Register holder_reg,
- Handle<JSObject> holder,
LookupResult* lookup,
Handle<Name> name);
void GenerateLoadPostInterceptor(Register reg,
- Handle<JSObject> interceptor_holder,
Handle<Name> name,
LookupResult* lookup);
@@ -553,39 +554,31 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler {
class NamedStoreHandlerCompiler : public PropertyHandlerCompiler {
public:
- explicit NamedStoreHandlerCompiler(Isolate* isolate, Handle<HeapType> type)
- : PropertyHandlerCompiler(isolate, Code::STORE_IC, type,
+ explicit NamedStoreHandlerCompiler(Isolate* isolate, Handle<HeapType> type,
+ Handle<JSObject> holder)
+ : PropertyHandlerCompiler(isolate, Code::STORE_IC, type, holder,
kCacheOnReceiver) {}
virtual ~NamedStoreHandlerCompiler() {}
- Handle<Code> CompileStoreTransition(Handle<JSObject> object,
- LookupResult* lookup,
+ Handle<Code> CompileStoreTransition(LookupResult* lookup,
Handle<Map> transition,
Handle<Name> name);
- Handle<Code> CompileStoreField(Handle<JSObject> object,
- LookupResult* lookup,
- Handle<Name> name);
+ Handle<Code> CompileStoreField(LookupResult* lookup, Handle<Name> name);
- Handle<Code> CompileStoreArrayLength(Handle<JSObject> object,
- LookupResult* lookup,
- Handle<Name> name);
+ Handle<Code> CompileStoreArrayLength(LookupResult* lookup, Handle<Name> name);
- Handle<Code> CompileStoreCallback(Handle<JSObject> object,
- Handle<JSObject> holder, Handle<Name> name,
+ Handle<Code> CompileStoreCallback(Handle<JSObject> object, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback);
- Handle<Code> CompileStoreCallback(Handle<JSObject> object,
- Handle<JSObject> holder, Handle<Name> name,
+ Handle<Code> CompileStoreCallback(Handle<JSObject> object, Handle<Name> name,
const CallOptimization& call_optimization);
- Handle<Code> CompileStoreViaSetter(Handle<JSObject> object,
- Handle<JSObject> holder, Handle<Name> name,
+ Handle<Code> CompileStoreViaSetter(Handle<JSObject> object, Handle<Name> name,
Handle<JSFunction> setter);
- Handle<Code> CompileStoreInterceptor(Handle<JSObject> object,
- Handle<Name> name);
+ Handle<Code> CompileStoreInterceptor(Handle<Name> name);
static void GenerateStoreViaSetter(MacroAssembler* masm,
@@ -598,8 +591,8 @@ class NamedStoreHandlerCompiler : public PropertyHandlerCompiler {
}
protected:
- virtual Register FrontendHeader(Register object_reg, Handle<JSObject> holder,
- Handle<Name> name, Label* miss);
+ virtual Register FrontendHeader(Register object_reg, Handle<Name> name,
+ Label* miss);
virtual void FrontendFooter(Handle<Name> name, Label* miss);
void GenerateRestoreName(MacroAssembler* masm, Label* label,
@@ -615,7 +608,6 @@ class NamedStoreHandlerCompiler : public PropertyHandlerCompiler {
Label* miss);
void GenerateStoreTransition(MacroAssembler* masm,
- Handle<JSObject> object,
LookupResult* lookup,
Handle<Map> transition,
Handle<Name> name,
@@ -655,7 +647,8 @@ class ElementHandlerCompiler : public PropertyHandlerCompiler {
public:
explicit ElementHandlerCompiler(Isolate* isolate)
: PropertyHandlerCompiler(isolate, Code::KEYED_LOAD_IC,
- Handle<HeapType>::null(), kCacheOnReceiver) {}
+ Handle<HeapType>::null(),
+ Handle<JSObject>::null(), kCacheOnReceiver) {}
virtual ~ElementHandlerCompiler() {}
« no previous file with comments | « src/ic.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698