Reviewers: Toon Verwaest,
Message:
Hey Toon,
This is the CL we were working on this morning. PTAL
-- Benedikt
Description:
Remove unused StubType's, freeing 2 bits in Code objects.
Please review this at https://codereview.chromium.org/75973005/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+38, -48 lines):
M src/arm/stub-cache-arm.cc
M src/code-stubs.h
M src/ia32/stub-cache-ia32.cc
M src/objects.h
M src/objects.cc
M src/stub-cache.cc
M src/x64/stub-cache-x64.cc
Index: src/arm/stub-cache-arm.cc
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc
index
2e3a0f8a3e4744294be395792901f5eaff001c4d..7e82fd016758d494e11e0024a792ca57487660ff
100644
--- a/src/arm/stub-cache-arm.cc
+++ b/src/arm/stub-cache-arm.cc
@@ -1650,7 +1650,7 @@ Handle<Code>
CallStubCompiler::CompileCallField(Handle<JSObject> object,
GenerateMissBranch();
// Return the generated code.
- return GetCode(Code::FIELD, name);
+ return GetCode(Code::FAST, name);
}
@@ -2681,7 +2681,7 @@ Handle<Code> CallStubCompiler::CompileCallConstant(
Handle<Code> code = CompileCustomCall(object, holder,
Handle<Cell>::null(),
function,
Handle<String>::cast(name),
- Code::CONSTANT);
+ Code::FAST);
// A null handle means bail out to the regular compiler code below.
if (!code.is_null()) return code;
}
@@ -2728,7 +2728,7 @@ Handle<Code>
CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
GenerateMissBranch();
// Return the generated code.
- return GetCode(Code::INTERCEPTOR, name);
+ return GetCode(Code::FAST, name);
}
@@ -2814,7 +2814,7 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
__ TailCallExternalReference(store_callback_property, 4, 1);
// Return the generated code.
- return GetCode(kind(), Code::CALLBACKS, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -2830,7 +2830,7 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
masm(), call_optimization, receiver(), scratch3(), 1, values);
// Return the generated code.
- return GetCode(kind(), Code::CALLBACKS, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -2913,7 +2913,7 @@ Handle<Code>
StoreStubCompiler::CompileStoreInterceptor(
TailCallBuiltin(masm(), MissBuiltin(kind()));
// Return the generated code.
- return GetCode(kind(), Code::INTERCEPTOR, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -2930,7 +2930,7 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
__ Ret();
// Return the generated code.
- return GetCode(kind(), Code::NONEXISTENT, name);
+ return GetCode(kind(), Code::FAST, name);
}
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index
0f35eec6e54b523e3d26c9b74cc49e6ef305d735..789983afcd8ca847b7784b31a21a7c27ba3f2bf3
100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -931,7 +931,7 @@ class LoadFieldStub: public HandlerStub {
return UnboxedDoubleBits::decode(bit_field_);
}
- virtual Code::StubType GetStubType() { return Code::FIELD; }
+ virtual Code::StubType GetStubType() { return Code::FAST; }
protected:
LoadFieldStub() : HandlerStub() { }
Index: src/ia32/stub-cache-ia32.cc
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
index
a3be0a777739e071980b4b57e73138768573f38e..16c2a18f5a1fa61a2827b7aa6099aebea1a53aaf
100644
--- a/src/ia32/stub-cache-ia32.cc
+++ b/src/ia32/stub-cache-ia32.cc
@@ -1671,7 +1671,7 @@ Handle<Code>
CallStubCompiler::CompileCallField(Handle<JSObject> object,
GenerateMissBranch();
// Return the generated code.
- return GetCode(Code::FIELD, name);
+ return GetCode(Code::FAST, name);
}
@@ -2752,7 +2752,7 @@ Handle<Code> CallStubCompiler::CompileCallConstant(
Handle<Code> code = CompileCustomCall(object, holder,
Handle<Cell>::null(),
function,
Handle<String>::cast(name),
- Code::CONSTANT);
+ Code::FAST);
// A null handle means bail out to the regular compiler code below.
if (!code.is_null()) return code;
}
@@ -2820,7 +2820,7 @@ Handle<Code>
CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
GenerateMissBranch();
// Return the generated code.
- return GetCode(Code::INTERCEPTOR, name);
+ return GetCode(Code::FAST, name);
}
@@ -2907,7 +2907,7 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
__ TailCallExternalReference(store_callback_property, 4, 1);
// Return the generated code.
- return GetCode(kind(), Code::CALLBACKS, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -2923,7 +2923,7 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
masm(), call_optimization, receiver(), scratch1(), 1, values);
// Return the generated code.
- return GetCode(kind(), Code::CALLBACKS, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -2990,7 +2990,7 @@ Handle<Code>
StoreStubCompiler::CompileStoreInterceptor(
__ TailCallExternalReference(store_ic_property, 4, 1);
// Return the generated code.
- return GetCode(kind(), Code::INTERCEPTOR, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -3035,7 +3035,7 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
__ ret(0);
// Return the generated code.
- return GetCode(kind(), Code::NONEXISTENT, name);
+ return GetCode(kind(), Code::FAST, name);
}
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
6cb5e212026de06051e8d83d9000964d4e3a7ba5..e5badbc83450193cd404900a521091e775e40948
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11075,12 +11075,7 @@ const char* Code::ICState2String(InlineCacheState
state) {
const char* Code::StubType2String(StubType type) {
switch (type) {
case NORMAL: return "NORMAL";
- case FIELD: return "FIELD";
- case CONSTANT: return "CONSTANT";
- case CALLBACKS: return "CALLBACKS";
- case INTERCEPTOR: return "INTERCEPTOR";
- case TRANSITION: return "TRANSITION";
- case NONEXISTENT: return "NONEXISTENT";
+ case FAST: return "FAST";
}
UNREACHABLE(); // keep the compiler happy
return NULL;
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index
c720c440b0400d94e71afb77f612960587ce88a5..7b421e2d0b56f832d96ac029f27b7082fe19a114
100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5033,12 +5033,7 @@ class Code: public HeapObject {
// Types of stubs.
enum StubType {
NORMAL,
- FIELD,
- CONSTANT,
- CALLBACKS,
- INTERCEPTOR,
- TRANSITION,
- NONEXISTENT
+ FAST
};
typedef int ExtraICState;
@@ -5464,7 +5459,7 @@ class Code: public HeapObject {
// Flags layout. BitField<type, shift, size>.
class ICStateField: public BitField<InlineCacheState, 0, 3> {};
- class TypeField: public BitField<StubType, 3, 3> {};
+ class TypeField: public BitField<StubType, 3, 1> {};
class CacheHolderField: public BitField<InlineCacheHolderFlag, 6, 1> {};
class KindField: public BitField<Kind, 7, 4> {};
class IsPregeneratedField: public BitField<bool, 11, 1> {};
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index
f9918ed62ef46c1286f743f37584527b3a3f7349..3d1a2e09124adc8cfa8ca9fe6907407d2470705a
100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -292,7 +292,7 @@ Handle<Code> StubCache::ComputeCallConstant(int argc,
}
Code::Flags flags = Code::ComputeMonomorphicFlags(
- kind, extra_state, cache_holder, Code::CONSTANT, argc);
+ kind, extra_state, cache_holder, Code::FAST, argc);
Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -334,7 +334,7 @@ Handle<Code> StubCache::ComputeCallField(int argc,
}
Code::Flags flags = Code::ComputeMonomorphicFlags(
- kind, extra_state, cache_holder, Code::FIELD, argc);
+ kind, extra_state, cache_holder, Code::FAST, argc);
Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -372,7 +372,7 @@ Handle<Code> StubCache::ComputeCallInterceptor(int argc,
}
Code::Flags flags = Code::ComputeMonomorphicFlags(
- kind, extra_state, cache_holder, Code::INTERCEPTOR, argc);
+ kind, extra_state, cache_holder, Code::FAST, argc);
Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -1259,7 +1259,7 @@ Handle<Code> LoadStubCompiler::CompileLoadField(
TailCallBuiltin(masm(), MissBuiltin(kind()));
// Return the generated code.
- return GetCode(kind(), Code::FIELD, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -1272,7 +1272,7 @@ Handle<Code> LoadStubCompiler::CompileLoadConstant(
GenerateLoadConstant(value);
// Return the generated code.
- return GetCode(kind(), Code::CONSTANT, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -1286,7 +1286,7 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback(
GenerateLoadCallback(reg, callback);
// Return the generated code.
- return GetCode(kind(), Code::CALLBACKS, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -1301,7 +1301,7 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback(
GenerateLoadCallback(call_optimization);
// Return the generated code.
- return GetCode(kind(), Code::CALLBACKS, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -1318,7 +1318,7 @@ Handle<Code> LoadStubCompiler::CompileLoadInterceptor(
GenerateLoadInterceptor(reg, object, holder, &lookup, name);
// Return the generated code.
- return GetCode(kind(), Code::INTERCEPTOR, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -1378,7 +1378,7 @@ Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
GenerateLoadViaGetter(masm(), receiver(), getter);
// Return the generated code.
- return GetCode(kind(), Code::CALLBACKS, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -1435,7 +1435,7 @@ Handle<Code>
StoreStubCompiler::CompileStoreTransition(
TailCallBuiltin(masm(), SlowBuiltin(kind()));
// Return the generated code.
- return GetCode(kind(), Code::TRANSITION, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -1458,7 +1458,7 @@ Handle<Code>
StoreStubCompiler::CompileStoreField(Handle<JSObject> object,
TailCallBuiltin(masm(), MissBuiltin(kind()));
// Return the generated code.
- return GetCode(kind(), Code::FIELD, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -1470,7 +1470,7 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
HandlerFrontend(object, receiver(), holder, name);
GenerateStoreViaSetter(masm(), setter);
- return GetCode(kind(), Code::CALLBACKS, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -1757,7 +1757,7 @@ Handle<Code>
CallStubCompiler::GetCode(Handle<JSFunction> function) {
if (function->shared()->name()->IsString()) {
function_name =
Handle<String>(String::cast(function->shared()->name()));
}
- return GetCode(Code::CONSTANT, function_name);
+ return GetCode(Code::FAST, function_name);
}
Index: src/x64/stub-cache-x64.cc
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
index
a1e8f211161e9c42cbfeffa0f9d9d3eb9818bcae..4c61f245a9582f7339676a89c5457356e0ee6233
100644
--- a/src/x64/stub-cache-x64.cc
+++ b/src/x64/stub-cache-x64.cc
@@ -1595,7 +1595,7 @@ Handle<Code>
CallStubCompiler::CompileCallField(Handle<JSObject> object,
GenerateMissBranch();
// Return the generated code.
- return GetCode(Code::FIELD, name);
+ return GetCode(Code::FAST, name);
}
@@ -2652,7 +2652,7 @@ Handle<Code> CallStubCompiler::CompileCallConstant(
Handle<Code> code = CompileCustomCall(object, holder,
Handle<PropertyCell>::null(),
function,
Handle<String>::cast(name),
- Code::CONSTANT);
+ Code::FAST);
// A null handle means bail out to the regular compiler code below.
if (!code.is_null()) return code;
}
@@ -2720,7 +2720,7 @@ Handle<Code>
CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
GenerateMissBranch();
// Return the generated code.
- return GetCode(Code::INTERCEPTOR, name);
+ return GetCode(Code::FAST, name);
}
@@ -2808,7 +2808,7 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
__ TailCallExternalReference(store_callback_property, 4, 1);
// Return the generated code.
- return GetCode(kind(), Code::CALLBACKS, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -2824,7 +2824,7 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
masm(), call_optimization, receiver(), scratch3(), 1, values);
// Return the generated code.
- return GetCode(kind(), Code::CALLBACKS, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -2891,7 +2891,7 @@ Handle<Code>
StoreStubCompiler::CompileStoreInterceptor(
__ TailCallExternalReference(store_ic_property, 4, 1);
// Return the generated code.
- return GetCode(kind(), Code::INTERCEPTOR, name);
+ return GetCode(kind(), Code::FAST, name);
}
@@ -2943,7 +2943,7 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
__ ret(0);
// Return the generated code.
- return GetCode(kind(), Code::NONEXISTENT, name);
+ return GetCode(kind(), Code::FAST, name);
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.