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

Unified Diff: src/code-stubs.h

Issue 2325013003: [stubs] Port StoreFieldStub to TurboFan. (Closed)
Patch Set: Created 4 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/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 d378044220c1dee79d560f3b3c07bdaee9cf6ff7..14e7f30cc690df2de6bcb439b9a9e4b5214fb20a 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -91,7 +91,6 @@ class ObjectLiteral;
V(LoadField) \
V(LoadScriptContextField) \
V(StoreFastElement) \
- V(StoreField) \
V(StoreGlobal) \
V(StoreScriptContextField) \
V(StoreTransition) \
@@ -168,6 +167,7 @@ class ObjectLiteral;
V(GetProperty) \
V(LoadICTF) \
V(KeyedLoadICTF) \
+ V(StoreField) \
V(StoreInterceptor) \
V(LoadApiGetter) \
V(LoadIndexedInterceptor) \
@@ -1632,37 +1632,38 @@ class LoadApiGetterStub : public TurboFanCodeStub {
DEFINE_TURBOFAN_CODE_STUB(LoadApiGetter, TurboFanCodeStub);
};
-class StoreFieldStub : public HandlerStub {
+class StoreFieldStub : public TurboFanCodeStub {
public:
StoreFieldStub(Isolate* isolate, FieldIndex index,
Representation representation)
- : HandlerStub(isolate) {
+ : TurboFanCodeStub(isolate) {
int property_index_key = index.GetFieldAccessStubKey();
- uint8_t repr = PropertyDetails::EncodeRepresentation(representation);
- set_sub_minor_key(StoreFieldByIndexBits::encode(property_index_key) |
- RepresentationBits::encode(repr));
+ minor_key_ = StoreFieldByIndexBits::encode(property_index_key) |
+ RepresentationBits::encode(representation.kind());
}
+ Code::Kind GetCodeKind() const override { return Code::HANDLER; }
+ ExtraICState GetExtraICState() const override { return Code::STORE_IC; }
+
FieldIndex index() const {
- int property_index_key = StoreFieldByIndexBits::decode(sub_minor_key());
+ int property_index_key = StoreFieldByIndexBits::decode(minor_key_);
return FieldIndex::FromFieldAccessStubKey(property_index_key);
}
- Representation representation() {
- uint8_t repr = RepresentationBits::decode(sub_minor_key());
- return PropertyDetails::DecodeRepresentation(repr);
+ Representation representation() const {
+ return Representation::FromKind(RepresentationBits::decode(minor_key_));
}
- protected:
- Code::Kind kind() const override { return Code::STORE_IC; }
-
private:
class StoreFieldByIndexBits : public BitField<int, 0, 13> {};
- class RepresentationBits : public BitField<uint8_t, 13, 4> {};
+ class RepresentationBits
+ : public BitField<Representation::Kind, StoreFieldByIndexBits::kNext, 4> {
+ };
+ STATIC_ASSERT(Representation::kNumRepresentations - 1 <
+ RepresentationBits::kMax);
- // TODO(ishell): The stub uses only kReceiver and kValue parameters.
DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector);
- DEFINE_HANDLER_CODE_STUB(StoreField, HandlerStub);
+ DEFINE_TURBOFAN_CODE_STUB(StoreField, 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