Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index 3fe65c4c15040dd73f6acad1b66af87c4ec1c9f2..95b225bdce06d4e8cb3760b9291be96b873c136f 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -738,6 +738,9 @@ bool Object::IsTransitionArray() const { |
| bool Object::IsTypeFeedbackVector() const { return IsFixedArray(); } |
| +bool Object::IsLiteralsArray() const { return IsFixedArray(); } |
| + |
| + |
| bool Object::IsDeoptimizationInputData() const { |
| // Must be a fixed array. |
| if (!IsFixedArray()) return false; |
| @@ -3469,6 +3472,55 @@ void DeoptimizationOutputData::SetPcAndState(int index, Smi* offset) { |
| } |
| +Object* LiteralsArray::get(int index) const { return FixedArray::get(index); } |
|
Igor Sheludko
2015/09/29 08:40:41
I think you can even leave these methods unimpleme
|
| + |
| + |
| +void LiteralsArray::set(int index, Object* value) { |
| + FixedArray::set(index, value); |
| +} |
| + |
| + |
| +void LiteralsArray::set(int index, Smi* value) { |
| + FixedArray::set(index, value); |
| +} |
| + |
| + |
| +void LiteralsArray::set(int index, Object* value, WriteBarrierMode mode) { |
| + FixedArray::set(index, value, mode); |
| +} |
| + |
| + |
| +LiteralsArray* LiteralsArray::cast(Object* object) { |
| + SLOW_DCHECK(object->IsLiteralsArray()); |
| + return reinterpret_cast<LiteralsArray*>(object); |
| +} |
| + |
| + |
| +TypeFeedbackVector* LiteralsArray::feedback_vector() const { |
| + return TypeFeedbackVector::cast(get(kVectorIndex)); |
|
Igor Sheludko
2015/09/29 08:40:41
... if you use FixedArray::get/FixedArray::set met
|
| +} |
| + |
| + |
| +void LiteralsArray::set_feedback_vector(TypeFeedbackVector* vector) { |
| + set(kVectorIndex, vector); |
| +} |
| + |
| + |
| +Object* LiteralsArray::literal(int literal_index) const { |
| + return get(kFirstLiteralIndex + literal_index); |
| +} |
| + |
| + |
| +void LiteralsArray::set_literal(int literal_index, Object* literal) { |
| + set(kFirstLiteralIndex + literal_index, literal); |
| +} |
| + |
| + |
| +int LiteralsArray::literals_count() const { |
| + return length() - kFirstLiteralIndex; |
| +} |
| + |
| + |
| void HandlerTable::SetRangeStart(int index, int value) { |
| set(index * kRangeEntrySize + kRangeStartIndex, Smi::FromInt(value)); |
| } |
| @@ -6273,13 +6325,13 @@ bool JSFunction::has_simple_parameters() { |
| } |
| -FixedArray* JSFunction::literals() { |
| +LiteralsArray* JSFunction::literals() { |
| DCHECK(!shared()->bound()); |
| - return literals_or_bindings(); |
| + return LiteralsArray::cast(literals_or_bindings()); |
| } |
| -void JSFunction::set_literals(FixedArray* literals) { |
| +void JSFunction::set_literals(LiteralsArray* literals) { |
| DCHECK(!shared()->bound()); |
| set_literals_or_bindings(literals); |
| } |