Chromium Code Reviews| 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); |
| }; |