| Index: src/code-stubs.h
|
| diff --git a/src/code-stubs.h b/src/code-stubs.h
|
| index 55d8b885c842326f219eb816289bb42e3f36c965..4a93f9920ad7409b70448c216a789864264a6ada 100644
|
| --- a/src/code-stubs.h
|
| +++ b/src/code-stubs.h
|
| @@ -897,9 +897,11 @@ class HandlerStub: public HICStub {
|
|
|
| class LoadFieldStub: public HandlerStub {
|
| public:
|
| - LoadFieldStub(Isolate* isolate, FieldIndex index)
|
| - : HandlerStub(isolate), index_(index) {
|
| - Initialize(Code::LOAD_IC);
|
| + LoadFieldStub(Isolate* isolate,
|
| + bool inobject,
|
| + int index, Representation representation)
|
| + : HandlerStub(isolate) {
|
| + Initialize(Code::LOAD_IC, inobject, index, representation);
|
| }
|
|
|
| virtual Handle<Code> GenerateCode() V8_OVERRIDE;
|
| @@ -916,30 +918,42 @@ class LoadFieldStub: public HandlerStub {
|
| return KindBits::decode(bit_field_);
|
| }
|
|
|
| - FieldIndex index() const { return index_; }
|
| + bool is_inobject() {
|
| + return InobjectBits::decode(bit_field_);
|
| + }
|
| +
|
| + int offset() {
|
| + int index = IndexBits::decode(bit_field_);
|
| + int offset = index * kPointerSize;
|
| + if (is_inobject()) return offset;
|
| + return FixedArray::kHeaderSize + offset;
|
| + }
|
|
|
| bool unboxed_double() {
|
| - return index_.is_double();
|
| + return UnboxedDoubleBits::decode(bit_field_);
|
| }
|
|
|
| virtual Code::StubType GetStubType() { return Code::FAST; }
|
|
|
| protected:
|
| - explicit LoadFieldStub(Isolate* isolate);
|
| + explicit LoadFieldStub(Isolate* isolate) : HandlerStub(isolate) { }
|
|
|
| - void Initialize(Code::Kind kind) {
|
| - int property_index_key = index_.GetLoadFieldStubKey();
|
| - // Save a copy of the essence of the property index into the bit field to
|
| - // make sure that hashing of unique stubs works correctly..
|
| - bit_field_ = KindBits::encode(kind) |
|
| - EncodedLoadFieldByIndexBits::encode(property_index_key);
|
| + void Initialize(Code::Kind kind,
|
| + bool inobject,
|
| + int index,
|
| + Representation representation) {
|
| + bit_field_ = KindBits::encode(kind)
|
| + | InobjectBits::encode(inobject)
|
| + | IndexBits::encode(index)
|
| + | UnboxedDoubleBits::encode(representation.IsDouble());
|
| }
|
|
|
| private:
|
| STATIC_ASSERT(KindBits::kSize == 4);
|
| - class EncodedLoadFieldByIndexBits: public BitField<int, 4, 13> {};
|
| + class InobjectBits: public BitField<bool, 4, 1> {};
|
| + class IndexBits: public BitField<int, 5, 11> {};
|
| + class UnboxedDoubleBits: public BitField<bool, 16, 1> {};
|
| virtual CodeStub::Major MajorKey() { return LoadField; }
|
| - FieldIndex index_;
|
| };
|
|
|
|
|
| @@ -1084,9 +1098,11 @@ class CallApiGetterStub : public PlatformCodeStub {
|
|
|
| class KeyedLoadFieldStub: public LoadFieldStub {
|
| public:
|
| - KeyedLoadFieldStub(Isolate* isolate, FieldIndex index)
|
| - : LoadFieldStub(isolate, index) {
|
| - Initialize(Code::KEYED_LOAD_IC);
|
| + KeyedLoadFieldStub(Isolate* isolate,
|
| + bool inobject,
|
| + int index, Representation representation)
|
| + : LoadFieldStub(isolate) {
|
| + Initialize(Code::KEYED_LOAD_IC, inobject, index, representation);
|
| }
|
|
|
| virtual void InitializeInterfaceDescriptor(
|
|
|