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

Unified Diff: src/code-stubs.h

Issue 1292173003: VectorICs: New interface descriptor for vector transitioning stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/arm64/interface-descriptors-arm64.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »
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 68d18c7a93860f73b2679fc2c7258f657a7b8fab..c7de00b858a2b0447f512d1d83f9579a2f22e955 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -329,8 +329,7 @@ struct FakeStubForTesting : public CodeStub {
Major MajorKey() const override { return CodeStub::NoCache; }
CallInterfaceDescriptor GetCallInterfaceDescriptor() const override {
- UNREACHABLE();
- return CallInterfaceDescriptor();
+ return ContextOnlyDescriptor(isolate());
}
Handle<Code> GenerateCode() override {
@@ -1278,6 +1277,69 @@ class StoreFieldStub : public HandlerStub {
};
+// Register and parameter access methods are specified here instead of in
+// the CallInterfaceDescriptor because the stub uses a different descriptor
+// if FLAG_vector_stores is on.
+class StoreTransitionHelper {
+ public:
+ static Register ReceiverRegister() {
+ return StoreTransitionDescriptor::ReceiverRegister();
+ }
+
+ static Register NameRegister() {
+ return StoreTransitionDescriptor::NameRegister();
+ }
+
+ static Register ValueRegister() {
+ return StoreTransitionDescriptor::ValueRegister();
+ }
+
+ static Register SlotRegister() {
+ DCHECK(FLAG_vector_stores);
+ return VectorStoreTransitionDescriptor::SlotRegister();
+ }
+
+ static Register VectorRegister() {
+ DCHECK(FLAG_vector_stores);
+ return VectorStoreTransitionDescriptor::VectorRegister();
+ }
+
+ static Register MapRegister() {
+ return FLAG_vector_stores ? VectorStoreTransitionDescriptor::MapRegister()
+ : StoreTransitionDescriptor::MapRegister();
+ }
+
+ static int ReceiverIndex() {
+ return StoreTransitionDescriptor::kReceiverIndex;
+ }
+
+ static int NameIndex() { return StoreTransitionDescriptor::kReceiverIndex; }
+
+ static int ValueIndex() { return StoreTransitionDescriptor::kValueIndex; }
+
+ static int SlotIndex() {
+ DCHECK(FLAG_vector_stores);
+ return VectorStoreTransitionDescriptor::kSlotIndex;
+ }
+
+ static int VectorIndex() {
+ DCHECK(FLAG_vector_stores);
+ return VectorStoreTransitionDescriptor::kVectorIndex;
+ }
+
+ static int MapIndex() {
+ if (FLAG_vector_stores) {
+ return VectorStoreTransitionDescriptor::kMapIndex;
+ }
+ return StoreTransitionDescriptor::kMapIndex;
+ }
+
+ // Some platforms push Slot, Vector, Map on the stack instead of in
+ // registers.
+ static bool UsesStackArgs() { return MapRegister().is(no_reg); }
+};
+
+
class StoreTransitionStub : public HandlerStub {
public:
enum StoreMode {
@@ -2606,12 +2668,18 @@ class StoreFastElementStub : public HydrogenCodeStub {
return StoreModeBits::decode(sub_minor_key());
}
+ CallInterfaceDescriptor GetCallInterfaceDescriptor() const override {
+ if (FLAG_vector_stores) {
+ return VectorStoreICDescriptor(isolate());
+ }
+ return StoreDescriptor(isolate());
+ }
+
private:
class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {};
class IsJSArrayBits: public BitField<bool, 12, 1> {};
- DEFINE_CALL_INTERFACE_DESCRIPTOR(Store);
DEFINE_HYDROGEN_CODE_STUB(StoreFastElement, HydrogenCodeStub);
};
@@ -2829,6 +2897,13 @@ class StoreElementStub : public PlatformCodeStub {
minor_key_ = ElementsKindBits::encode(elements_kind);
}
+ CallInterfaceDescriptor GetCallInterfaceDescriptor() const override {
+ if (FLAG_vector_stores) {
+ return VectorStoreICDescriptor(isolate());
+ }
+ return StoreDescriptor(isolate());
+ }
+
private:
ElementsKind elements_kind() const {
return ElementsKindBits::decode(minor_key_);
@@ -2836,7 +2911,6 @@ class StoreElementStub : public PlatformCodeStub {
class ElementsKindBits : public BitField<ElementsKind, 0, 8> {};
- DEFINE_CALL_INTERFACE_DESCRIPTOR(Store);
DEFINE_PLATFORM_CODE_STUB(StoreElement, PlatformCodeStub);
};
@@ -2951,13 +3025,14 @@ class ElementsTransitionAndStoreStub : public HydrogenCodeStub {
return StoreModeBits::decode(sub_minor_key());
}
+ CallInterfaceDescriptor GetCallInterfaceDescriptor() const override;
+
private:
class FromBits : public BitField<ElementsKind, 0, 8> {};
class ToBits : public BitField<ElementsKind, 8, 8> {};
class IsJSArrayBits : public BitField<bool, 16, 1> {};
class StoreModeBits : public BitField<KeyedAccessStoreMode, 17, 4> {};
- DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreTransition);
DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub);
};
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698