Chromium Code Reviews| Index: src/code-stubs.h |
| diff --git a/src/code-stubs.h b/src/code-stubs.h |
| index 01f83ed54f5f7afa5274919620643b7521458fca..cd0be87c1787d182b8f5ab4a9e9283ca278cdf36 100644 |
| --- a/src/code-stubs.h |
| +++ b/src/code-stubs.h |
| @@ -76,6 +76,7 @@ namespace internal { |
| V(CallApiGetter) \ |
| /* IC Handler stubs */ \ |
| V(LoadField) \ |
| + V(StoreField) \ |
| V(LoadConstant) \ |
| V(StringLength) |
| @@ -920,19 +921,13 @@ class LoadFieldStub: public HandlerStub { |
| public: |
| LoadFieldStub(Isolate* isolate, FieldIndex index) |
| : HandlerStub(isolate), index_(index) { |
| - int property_index_key = index_.GetLoadFieldStubKey(); |
| + int property_index_key = index_.GetFieldAccessStubKey(); |
| bit_field_ = EncodedLoadFieldByIndexBits::encode(property_index_key); |
| } |
| virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
| - Representation representation() { |
| - if (unboxed_double()) return Representation::Double(); |
| - return Representation::Tagged(); |
| - } |
| - |
| FieldIndex index() const { return index_; } |
| - bool unboxed_double() { return index_.is_double(); } |
| protected: |
| explicit LoadFieldStub(Isolate* isolate); |
| @@ -980,6 +975,37 @@ class StringLengthStub: public HandlerStub { |
| }; |
| +class StoreFieldStub : public HandlerStub { |
| + public: |
| + StoreFieldStub(Isolate* isolate, FieldIndex index, |
| + Representation representation) |
| + : HandlerStub(isolate), index_(index), representation_(representation) { |
| + int property_index_key = index_.GetFieldAccessStubKey(); |
| + bit_field_ = EncodedStoreFieldByIndexBits::encode(property_index_key) | |
| + RepresentationBits::encode( |
| + PropertyDetails::EncodeRepresentation(representation)); |
| + ; |
|
Jakob Kummerow
2014/08/06 09:19:41
I don't think this is needed
Toon Verwaest
2014/08/06 09:26:36
Done.
|
| + } |
| + |
| + virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
| + |
| + FieldIndex index() const { return index_; } |
| + Representation representation() { return representation_; } |
| + |
| + protected: |
| + explicit StoreFieldStub(Isolate* isolate); |
| + virtual Code::Kind kind() const { return Code::STORE_IC; } |
| + virtual Code::StubType GetStubType() { return Code::FAST; } |
| + |
| + private: |
| + class EncodedStoreFieldByIndexBits : public BitField<int, 0, 13> {}; |
| + class RepresentationBits : public BitField<int, 13, 4> {}; |
| + virtual CodeStub::Major MajorKey() const { return StoreField; } |
| + FieldIndex index_; |
| + Representation representation_; |
|
Jakob Kummerow
2014/08/06 09:19:41
Are you intentionally storing the representation t
Toon Verwaest
2014/08/06 09:26:36
Yeah, same as for the field index. The bit_field_
|
| +}; |
| + |
| + |
| class StoreGlobalStub : public HandlerStub { |
| public: |
| StoreGlobalStub(Isolate* isolate, bool is_constant, bool check_global) |