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

Unified Diff: src/ic.h

Issue 295383004: Refactor CallICStub to use a different stub for each customization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 years, 7 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/ia32/code-stubs-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.h
diff --git a/src/ic.h b/src/ic.h
index cb60bcb86a6de0a1e738d1318a68365cb5985495..92dd773198ae0144022b8dd655259d91def0a0b1 100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -20,6 +20,7 @@ const int kMaxKeyedPolymorphism = 4;
ICU(LoadIC_Miss) \
ICU(KeyedLoadIC_Miss) \
ICU(CallIC_Miss) \
+ ICU(CallIC_Customization_Miss) \
ICU(StoreIC_Miss) \
ICU(StoreIC_ArrayLength) \
ICU(StoreIC_Slow) \
@@ -333,34 +334,16 @@ class IC_Utility {
class CallIC: public IC {
public:
enum CallType { METHOD, FUNCTION };
- enum StubType { DEFAULT, MONOMORPHIC_ARRAY };
class State V8_FINAL BASE_EMBEDDED {
public:
explicit State(ExtraICState extra_ic_state);
- static State MonomorphicArrayCallState(int argc, CallType call_type) {
- return State(argc, call_type, MONOMORPHIC_ARRAY);
+ State(int argc, CallType call_type)
+ : argc_(argc), call_type_(call_type) {
}
- static State DefaultCallState(int argc, CallType call_type) {
- return State(argc, call_type, DEFAULT);
- }
-
- // Transition from the current state to another.
- State ToGenericState() const {
- return DefaultCallState(arg_count(), call_type());
- }
-
- State ToMonomorphicArrayCallState() const {
- return MonomorphicArrayCallState(arg_count(), call_type());
- }
-
- InlineCacheState GetICState() const {
- return stub_type_ == CallIC::DEFAULT
- ? ::v8::internal::GENERIC
- : ::v8::internal::MONOMORPHIC;
- }
+ InlineCacheState GetICState() const { return ::v8::internal::GENERIC; }
ExtraICState GetExtraICState() const;
@@ -369,43 +352,25 @@ class CallIC: public IC {
int arg_count() const { return argc_; }
CallType call_type() const { return call_type_; }
- StubType stub_type() const { return stub_type_; }
bool CallAsMethod() const { return call_type_ == METHOD; }
void Print(StringStream* stream) const;
- bool operator==(const State& other_state) const {
- return (argc_ == other_state.argc_ &&
- call_type_ == other_state.call_type_ &&
- stub_type_ == other_state.stub_type_);
- }
-
- bool operator!=(const State& other_state) const {
- return !(*this == other_state);
- }
-
private:
- State(int argc, CallType call_type, StubType stub_type)
- : argc_(argc),
- call_type_(call_type),
- stub_type_(stub_type) {
- }
-
class ArgcBits: public BitField<int, 0, Code::kArgumentsBits> {};
class CallTypeBits: public BitField<CallType, Code::kArgumentsBits, 1> {};
- class StubTypeBits:
- public BitField<StubType, Code::kArgumentsBits + 1, 1> {}; // NOLINT
const int argc_;
const CallType call_type_;
- const StubType stub_type_;
};
explicit CallIC(Isolate* isolate)
: IC(EXTRA_CALL_FRAME, isolate) {
}
+ void PatchMegamorphic(Handle<FixedArray> vector, Handle<Smi> slot);
+
void HandleMiss(Handle<Object> receiver,
Handle<Object> function,
Handle<FixedArray> vector,
@@ -416,7 +381,7 @@ class CallIC: public IC {
Handle<Object> function,
Handle<FixedArray> vector,
Handle<Smi> slot,
- const State& new_state);
+ const State& state);
// Code generator routines.
static Handle<Code> initialize_stub(Isolate* isolate,
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698