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

Unified Diff: src/code-stubs.h

Issue 23537067: Add support for keyed-call on arrays of fast elements (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Compare with actual map loaded from the context Created 7 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
« no previous file with comments | « src/ast.cc ('k') | src/code-stubs.cc » ('j') | src/code-stubs-hydrogen.cc » ('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 a5c2f88b228e85993ffb5271e54cb83026d4254c..2b4570e0e5ad60ea2b5b2a4795947a972d37f1a7 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -88,13 +88,15 @@ namespace internal {
V(TransitionElementsKind) \
V(StoreArrayLiteralElement) \
V(StubFailureTrampoline) \
+ V(CallStubFailureTrampoline) \
V(ArrayConstructor) \
V(InternalArrayConstructor) \
V(ProfileEntryHook) \
V(StoreGlobal) \
/* IC Handler stubs */ \
V(LoadField) \
- V(KeyedLoadField)
+ V(KeyedLoadField) \
+ V(KeyedArrayCall)
// List of code stubs only used on ARM platforms.
#if V8_TARGET_ARCH_ARM
@@ -168,6 +170,7 @@ class CodeStub BASE_EMBEDDED {
virtual bool IsPregenerated(Isolate* isolate) { return false; }
static void GenerateStubsAheadOfTime(Isolate* isolate);
+ static void GenerateStubsRequiringBuiltinsAheadOfTime(Isolate* isolate);
static void GenerateFPStubs(Isolate* isolate);
// Some stubs put untagged junk on the stack that cannot be scanned by the
@@ -282,6 +285,7 @@ struct CodeStubInterfaceDescriptor {
// if hint_stack_parameter_count_ > 0, the code stub can optimize the
// return sequence. Default value is -1, which means it is ignored.
int hint_stack_parameter_count_;
+ bool call_stub_;
StubFunctionMode function_mode_;
Register* register_params_;
Address deoptimization_handler_;
@@ -909,6 +913,8 @@ class HandlerStub: public HICStub {
protected:
HandlerStub() : HICStub() { }
+ virtual int NotMissMinorKey() { return bit_field_; }
+ int bit_field_;
};
@@ -971,9 +977,6 @@ class LoadFieldStub: public HandlerStub {
class IndexBits: public BitField<int, 5, 11> {};
class UnboxedDoubleBits: public BitField<bool, 16, 1> {};
virtual CodeStub::Major MajorKey() { return LoadField; }
- virtual int NotMissMinorKey() { return bit_field_; }
-
- int bit_field_;
};
@@ -995,6 +998,51 @@ class KeyedLoadFieldStub: public LoadFieldStub {
};
+class KeyedArrayCallStub: public HICStub {
+ public:
+ KeyedArrayCallStub(bool holey, int argc) : HICStub(), argc_(argc) {
+ bit_field_ = KindBits::encode(Code::KEYED_CALL_IC)
+ | HoleyBits::encode(holey);
+ }
+
+ virtual Code::Kind kind() const {
+ return KindBits::decode(bit_field_);
+ }
+
+ virtual Code::ExtraICState GetExtraICState() { return bit_field_; }
+
+ ElementsKind elements_kind() {
+ return HoleyBits::decode(bit_field_) ? FAST_HOLEY_ELEMENTS : FAST_ELEMENTS;
+ }
+
+ int argc() { return argc_; }
+ virtual int GetStubFlags() { return argc(); }
+
+ static bool IsHoley(Handle<Code> code) {
+ Code::ExtraICState state = code->extra_ic_state();
+ return HoleyBits::decode(state);
+ }
+
+ virtual void InitializeInterfaceDescriptor(
+ Isolate* isolate,
+ CodeStubInterfaceDescriptor* descriptor);
+
+ virtual Handle<Code> GenerateCode(Isolate* isolate);
+
+ private:
+ virtual int NotMissMinorKey() {
+ return GetExtraICState() | ArgcBits::encode(argc_);
+ }
+
+ STATIC_ASSERT(KindBits::kSize == 4);
+ class HoleyBits: public BitField<bool, 4, 1> {};
+ class ArgcBits: public BitField<int, 5, 20> {};
danno 2013/10/02 08:49:11 Don't we have a constant somewhere with the number
Toon Verwaest 2013/10/02 16:28:16 Done.
+ virtual CodeStub::Major MajorKey() { return KeyedArrayCall; }
+ int bit_field_;
+ int argc_;
+};
+
+
class BinaryOpStub: public PlatformCodeStub {
public:
BinaryOpStub(Token::Value op, OverwriteMode mode)
@@ -2300,6 +2348,27 @@ class StubFailureTrampolineStub : public PlatformCodeStub {
};
+class CallStubFailureTrampolineStub : public PlatformCodeStub {
+ public:
+ CallStubFailureTrampolineStub() : fp_registers_(CanUseFPRegisters()) {}
+
+ virtual bool IsPregenerated(Isolate* isolate) V8_OVERRIDE { return true; }
+
+ static void GenerateAheadOfTime(Isolate* isolate);
+
+ private:
+ class FPRegisters: public BitField<bool, 0, 1> {};
danno 2013/10/02 08:49:11 nit: crazy unnecessary spacing on the line above.
Toon Verwaest 2013/10/02 16:28:16 Done.
+ Major MajorKey() { return CallStubFailureTrampoline; }
+ int MinorKey() { return FPRegisters::encode(fp_registers_); }
+
+ void Generate(MacroAssembler* masm);
+
+ bool fp_registers_;
+
+ DISALLOW_COPY_AND_ASSIGN(CallStubFailureTrampolineStub);
+};
+
+
class ProfileEntryHookStub : public PlatformCodeStub {
public:
explicit ProfileEntryHookStub() {}
« no previous file with comments | « src/ast.cc ('k') | src/code-stubs.cc » ('j') | src/code-stubs-hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698