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

Unified Diff: src/stub-cache.h

Issue 8068026: Begin to handlify the stub cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 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.h
diff --git a/src/stub-cache.h b/src/stub-cache.h
index fcb58e1f0828a360cc191ef27f201bbf61a0040f..2926ca41db4759559284ff1a093984435429f45c 100644
--- a/src/stub-cache.h
+++ b/src/stub-cache.h
@@ -72,43 +72,35 @@ class StubCache {
void Initialize(bool create_heap_objects);
+ Handle<Code> ComputeLoadNonexistent(Handle<String> name,
+ Handle<JSObject> receiver);
- // Computes the right stub matching. Inserts the result in the
- // cache before returning. This might compile a stub if needed.
- MUST_USE_RESULT MaybeObject* ComputeLoadNonexistent(
- String* name,
- JSObject* receiver);
+ Handle<Code> ComputeLoadField(Handle<String> name,
+ Handle<JSObject> receiver,
+ Handle<JSObject> holder,
+ int field_index);
- MUST_USE_RESULT MaybeObject* ComputeLoadField(String* name,
- JSObject* receiver,
- JSObject* holder,
- int field_index);
+ Handle<Code> ComputeLoadCallback(Handle<String> name,
+ Handle<JSObject> receiver,
+ Handle<JSObject> holder,
+ Handle<AccessorInfo> callback);
- MUST_USE_RESULT MaybeObject* ComputeLoadCallback(
- String* name,
- JSObject* receiver,
- JSObject* holder,
- AccessorInfo* callback);
+ Handle<Code> ComputeLoadConstant(Handle<String> name,
+ Handle<JSObject> receiver,
+ Handle<JSObject> holder,
+ Handle<Object> value);
- MUST_USE_RESULT MaybeObject* ComputeLoadConstant(String* name,
- JSObject* receiver,
- JSObject* holder,
- Object* value);
+ Handle<Code> ComputeLoadInterceptor(Handle<String> name,
+ Handle<JSObject> receiver,
+ Handle<JSObject> holder);
- MUST_USE_RESULT MaybeObject* ComputeLoadInterceptor(
- String* name,
- JSObject* receiver,
- JSObject* holder);
+ Handle<Code> ComputeLoadNormal();
- MUST_USE_RESULT MaybeObject* ComputeLoadNormal();
-
-
- MUST_USE_RESULT MaybeObject* ComputeLoadGlobal(
- String* name,
- JSObject* receiver,
- GlobalObject* holder,
- JSGlobalPropertyCell* cell,
- bool is_dont_delete);
+ Handle<Code> ComputeLoadGlobal(Handle<String> name,
+ Handle<JSObject> receiver,
+ Handle<GlobalObject> holder,
+ Handle<JSGlobalPropertyCell> cell,
+ bool is_dont_delete);
// ---
@@ -329,6 +321,7 @@ class StubCache {
Isolate* isolate() { return isolate_; }
Heap* heap() { return isolate()->heap(); }
+ Factory* factory() { return isolate()->factory(); }
private:
explicit StubCache(Isolate* isolate);
@@ -409,8 +402,8 @@ DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadPropertyWithInterceptor);
// The stub compiler compiles stubs for the stub cache.
class StubCompiler BASE_EMBEDDED {
public:
- StubCompiler()
- : scope_(), masm_(Isolate::Current(), NULL, 256), failure_(NULL) { }
+ explicit StubCompiler(Isolate* isolate)
+ : isolate_(isolate), masm_(isolate, NULL, 256), failure_(NULL) { }
MUST_USE_RESULT MaybeObject* CompileCallInitialize(Code::Flags flags);
MUST_USE_RESULT MaybeObject* CompileCallPreMonomorphic(Code::Flags flags);
@@ -566,12 +559,12 @@ class StubCompiler BASE_EMBEDDED {
String* name,
LookupResult* lookup);
- Isolate* isolate() { return scope_.isolate(); }
+ Isolate* isolate() { return isolate_; }
Heap* heap() { return isolate()->heap(); }
Factory* factory() { return isolate()->factory(); }
private:
- HandleScope scope_;
+ Isolate* isolate_;
MacroAssembler masm_;
Failure* failure_;
};
@@ -579,6 +572,8 @@ class StubCompiler BASE_EMBEDDED {
class LoadStubCompiler: public StubCompiler {
public:
+ explicit LoadStubCompiler(Isolate* isolate) : StubCompiler(isolate) { }
+
MUST_USE_RESULT MaybeObject* CompileLoadNonexistent(String* name,
JSObject* object,
JSObject* last);
@@ -615,6 +610,8 @@ class LoadStubCompiler: public StubCompiler {
class KeyedLoadStubCompiler: public StubCompiler {
public:
+ explicit KeyedLoadStubCompiler(Isolate* isolate) : StubCompiler(isolate) { }
+
MUST_USE_RESULT MaybeObject* CompileLoadField(String* name,
JSObject* object,
JSObject* holder,
@@ -662,8 +659,8 @@ class KeyedLoadStubCompiler: public StubCompiler {
class StoreStubCompiler: public StubCompiler {
public:
- explicit StoreStubCompiler(StrictModeFlag strict_mode)
- : strict_mode_(strict_mode) { }
+ StoreStubCompiler(Isolate* isolate, StrictModeFlag strict_mode)
+ : StubCompiler(isolate), strict_mode_(strict_mode) { }
MUST_USE_RESULT MaybeObject* CompileStoreField(JSObject* object,
int index,
@@ -689,8 +686,8 @@ class StoreStubCompiler: public StubCompiler {
class KeyedStoreStubCompiler: public StubCompiler {
public:
- explicit KeyedStoreStubCompiler(StrictModeFlag strict_mode)
- : strict_mode_(strict_mode) { }
+ KeyedStoreStubCompiler(Isolate* isolate, StrictModeFlag strict_mode)
+ : StubCompiler(isolate), strict_mode_(strict_mode) { }
MUST_USE_RESULT MaybeObject* CompileStoreField(JSObject* object,
int index,
@@ -740,7 +737,8 @@ class CallOptimization;
class CallStubCompiler: public StubCompiler {
public:
- CallStubCompiler(int argc,
+ CallStubCompiler(Isolate* isolate,
+ int argc,
Code::Kind kind,
Code::ExtraICState extra_ic_state,
InlineCacheHolderFlag cache_holder);
@@ -833,7 +831,7 @@ class CallStubCompiler: public StubCompiler {
class ConstructStubCompiler: public StubCompiler {
public:
- explicit ConstructStubCompiler() {}
+ explicit ConstructStubCompiler(Isolate* isolate) : StubCompiler(isolate) { }
MUST_USE_RESULT MaybeObject* CompileConstructStub(JSFunction* function);

Powered by Google App Engine
This is Rietveld 408576698