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

Unified Diff: src/code-stubs.h

Issue 2397573004: [stubs] Reduce number of StoreTransitionStub instances. (Closed)
Patch Set: Cleanup Created 4 years, 2 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/code-stub-assembler.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 453a54ca6567e0068cac28facdc052f701cb6e90..2b25ea3bb0a967df7fe8474e11b61e63bf3b1ec6 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -159,6 +159,7 @@ class ObjectLiteral;
V(StoreGlobal) \
V(StoreICTF) \
V(StoreInterceptor) \
+ V(StoreMap) \
V(StoreTransition) \
V(LoadApiGetter) \
V(LoadIndexedInterceptor) \
@@ -1610,24 +1611,29 @@ class StoreFieldStub : public TurboFanCodeStub {
DEFINE_TURBOFAN_CODE_STUB(StoreField, TurboFanCodeStub);
};
+class StoreMapStub : public TurboFanCodeStub {
+ public:
+ explicit StoreMapStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
+
+ Code::Kind GetCodeKind() const override { return Code::HANDLER; }
+ ExtraICState GetExtraICState() const override { return Code::STORE_IC; }
+
+ private:
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreTransition);
+ DEFINE_TURBOFAN_CODE_STUB(StoreMap, TurboFanCodeStub);
+};
+
class StoreTransitionStub : public TurboFanCodeStub {
public:
enum StoreMode {
- StoreMapOnly,
StoreMapAndValue,
ExtendStorageAndStoreMapAndValue
};
- explicit StoreTransitionStub(Isolate* isolate) : TurboFanCodeStub(isolate) {
- minor_key_ = StoreModeBits::encode(StoreMapOnly);
- }
-
- StoreTransitionStub(Isolate* isolate, FieldIndex index,
+ StoreTransitionStub(Isolate* isolate, bool is_inobject,
Representation representation, StoreMode store_mode)
: TurboFanCodeStub(isolate) {
- DCHECK(store_mode != StoreMapOnly);
- int property_index_key = index.GetFieldAccessStubKey();
- minor_key_ = StoreFieldByIndexBits::encode(property_index_key) |
+ minor_key_ = IsInobjectBits::encode(is_inobject) |
RepresentationBits::encode(representation.kind()) |
StoreModeBits::encode(store_mode);
}
@@ -1635,27 +1641,24 @@ class StoreTransitionStub : public TurboFanCodeStub {
Code::Kind GetCodeKind() const override { return Code::HANDLER; }
ExtraICState GetExtraICState() const override { return Code::STORE_IC; }
- FieldIndex index() const {
- DCHECK(store_mode() != StoreMapOnly);
- int property_index_key = StoreFieldByIndexBits::decode(minor_key_);
- return FieldIndex::FromFieldAccessStubKey(property_index_key);
- }
+ bool is_inobject() const { return IsInobjectBits::decode(minor_key_); }
Representation representation() const {
- DCHECK(store_mode() != StoreMapOnly);
return Representation::FromKind(RepresentationBits::decode(minor_key_));
}
StoreMode store_mode() const { return StoreModeBits::decode(minor_key_); }
private:
- class StoreFieldByIndexBits : public BitField<int, 0, 13> {};
- class RepresentationBits : public BitField<Representation::Kind, 13, 4> {};
+ class IsInobjectBits : public BitField<bool, 0, 1> {};
+ class RepresentationBits
+ : public BitField<Representation::Kind, IsInobjectBits::kNext, 4> {};
STATIC_ASSERT(Representation::kNumRepresentations - 1 <
RepresentationBits::kMax);
- class StoreModeBits : public BitField<StoreMode, 17, 2> {};
+ class StoreModeBits
+ : public BitField<StoreMode, RepresentationBits::kNext, 1> {};
- DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreTransition);
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreNamedTransition);
DEFINE_TURBOFAN_CODE_STUB(StoreTransition, TurboFanCodeStub);
};
« no previous file with comments | « src/code-stub-assembler.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698