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

Unified Diff: src/code-stubs.h

Issue 609463003: Hydrogenize (and share) part of StoreTransition handler as a StoreTransitionStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Further simplification Created 6 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/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 8b6f109e17d070300c74a874553547c7bbf821f3..20120c96db0a098e151f62f3cf8ff1fddf6c83bb 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -83,7 +83,7 @@ namespace internal {
V(LoadConstant) \
V(LoadField) \
V(StoreField) \
- V(ExtendStorage) \
+ V(StoreTransition) \
Yang 2014/09/30 11:56:53 alpha-sort.
Igor Sheludko 2014/09/30 14:54:53 Done.
V(StoreGlobal) \
V(StringLength)
@@ -985,27 +985,45 @@ class StoreFieldStub : public HandlerStub {
// Extend storage is called in a store inline cache when
Yang 2014/09/30 11:56:53 not sure if comment outdated.
Igor Sheludko 2014/09/30 14:54:53 Done.
// it is necessary to extend the properties array of a
// JSObject.
-class ExtendStorageStub : public HandlerStub {
+class StoreTransitionStub : public HandlerStub {
public:
- ExtendStorageStub(Isolate* isolate, FieldIndex index,
- Representation representation)
+ enum StoreMode {
+ StoreMapOnly,
+ StoreMapAndValue,
+ ExtendStorageAndStoreMapAndValue
+ };
+
+ explicit StoreTransitionStub(Isolate* isolate) : HandlerStub(isolate) {
+ set_sub_minor_key(StoreModeBits::encode(StoreMapOnly));
+ }
+
+ StoreTransitionStub(Isolate* isolate, FieldIndex index,
+ Representation representation, StoreMode store_mode)
: HandlerStub(isolate) {
+ DCHECK(store_mode != StoreMapOnly);
int property_index_key = index.GetFieldAccessStubKey();
uint8_t repr = PropertyDetails::EncodeRepresentation(representation);
set_sub_minor_key(StoreFieldByIndexBits::encode(property_index_key) |
- RepresentationBits::encode(repr));
+ RepresentationBits::encode(repr) |
+ StoreModeBits::encode(store_mode));
}
FieldIndex index() const {
+ DCHECK(store_mode() != StoreMapOnly);
int property_index_key = StoreFieldByIndexBits::decode(sub_minor_key());
return FieldIndex::FromFieldAccessStubKey(property_index_key);
}
Representation representation() {
+ DCHECK(store_mode() != StoreMapOnly);
uint8_t repr = RepresentationBits::decode(sub_minor_key());
return PropertyDetails::DecodeRepresentation(repr);
}
+ StoreMode store_mode() const {
+ return StoreModeBits::decode(sub_minor_key());
+ }
+
virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE;
protected:
@@ -1015,8 +1033,9 @@ class ExtendStorageStub : public HandlerStub {
private:
class StoreFieldByIndexBits : public BitField<int, 0, 13> {};
class RepresentationBits : public BitField<uint8_t, 13, 4> {};
+ class StoreModeBits : public BitField<StoreMode, 17, 2> {};
- DEFINE_HANDLER_CODE_STUB(ExtendStorage, HandlerStub);
+ DEFINE_HANDLER_CODE_STUB(StoreTransition, HandlerStub);
};
« 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