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

Unified Diff: src/code-stubs.h

Issue 12340112: Polymorphism support for load IC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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/builtins.h ('k') | src/code-stubs.cc » ('j') | src/ic.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index cd90b70e9073e16ea5cf6dcde29f8120d3483630..cf2119fcf6de941093e060f493e85c7a984e4531 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -80,7 +80,9 @@ namespace internal {
V(TransitionElementsKind) \
V(StoreArrayLiteralElement) \
V(StubFailureTrampoline) \
- V(ProfileEntryHook)
+ V(ProfileEntryHook) \
+ /* IC Handler stubs */ \
+ V(LoadField)
// List of code stubs only used on ARM platforms.
#ifdef V8_TARGET_ARCH_ARM
@@ -185,6 +187,9 @@ class CodeStub BASE_EMBEDDED {
virtual Code::ExtraICState GetExtraICState() {
return Code::kNoExtraICState;
}
+ virtual Code::StubType GetStubType() {
+ return Code::NORMAL;
+ }
// Returns whether the code generated for this stub needs to be allocated as
// a fixed (non-moveable) code object.
@@ -649,6 +654,46 @@ class StoreArrayLengthStub: public StoreICStub {
};
+class HandlerStub: public ICStub {
+ public:
+ explicit HandlerStub(Code::Kind kind) : ICStub(kind) { }
+
+ protected:
+ virtual Code::ExtraICState GetExtraICState() {
+ return Code::HANDLER_FRAGMENT;
+ }
+};
+
+
+class LoadFieldStub: public HandlerStub {
+ public:
+ enum FieldMode { HEADER, INOBJECT, PROPERTIES };
+ LoadFieldStub(Register reg, bool inobject, int index)
+ : HandlerStub(Code::LOAD_IC), reg_(reg),
Jakob Kummerow 2013/03/01 22:21:04 nit: let's give each initializer statement its own
Toon Verwaest 2013/03/04 10:54:08 Done.
+ inobject_(inobject), index_(index) { }
+ virtual void Generate(MacroAssembler* masm);
+
+ protected:
+ virtual Code::StubType GetStubType() { return Code::FIELD; }
+
+ private:
+ class RegisterBits: public BitField<int, 1, 4> {};
Jakob Kummerow 2013/03/01 22:21:04 Looks like something's wrong with those bit fields
Toon Verwaest 2013/03/04 10:54:08 Doh, what did I do there. 2**11 is a reasonable u
+ class InobjectBits: public BitField<bool, 6, 4> {};
+ class IndexBits: public BitField<int, 10, 11> {};
+ virtual CodeStub::Major MajorKey() { return LoadField; }
+ virtual int MinorKey() {
+ return HandlerStub::MinorKey()
+ | RegisterBits::encode(reg_.code())
+ | InobjectBits::encode(inobject_)
+ | IndexBits::encode(index_);
+ }
+
+ Register reg_;
+ bool inobject_;
+ int index_;
+};
+
+
class BinaryOpStub: public PlatformCodeStub {
public:
BinaryOpStub(Token::Value op, OverwriteMode mode)
« no previous file with comments | « src/builtins.h ('k') | src/code-stubs.cc » ('j') | src/ic.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698