Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 3d39278cce9bd49437e76764f577900cdedb9ad0..96b3620a97458f0acfa482968d4f0b2257a84fdb 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -731,6 +731,7 @@ bool Object::IsTypeFeedbackVector() const { return IsFixedArray(); } |
bool Object::IsLiteralsArray() const { return IsFixedArray(); } |
+bool Object::IsBindingsArray() const { return IsFixedArray(); } |
bool Object::IsDeoptimizationInputData() const { |
@@ -3506,6 +3507,75 @@ int LiteralsArray::literals_count() const { |
} |
+Object* BindingsArray::get(int index) const { return FixedArray::get(index); } |
+ |
+ |
+void BindingsArray::set(int index, Object* value) { |
+ FixedArray::set(index, value); |
+} |
+ |
+ |
+void BindingsArray::set(int index, Smi* value) { |
+ FixedArray::set(index, value); |
+} |
+ |
+ |
+void BindingsArray::set(int index, Object* value, WriteBarrierMode mode) { |
+ FixedArray::set(index, value, mode); |
+} |
+ |
+ |
+int BindingsArray::length() const { return FixedArray::length(); } |
+ |
+ |
+BindingsArray* BindingsArray::cast(Object* object) { |
+ SLOW_DCHECK(object->IsBindingsArray()); |
+ return reinterpret_cast<BindingsArray*>(object); |
+} |
+ |
+void BindingsArray::set_feedback_vector(TypeFeedbackVector* vector) { |
+ set(kVectorIndex, vector); |
+} |
+ |
+ |
+TypeFeedbackVector* BindingsArray::feedback_vector() const { |
+ return TypeFeedbackVector::cast(get(kVectorIndex)); |
+} |
+ |
+ |
+JSReceiver* BindingsArray::bound_function() const { |
+ return JSReceiver::cast(get(kBoundFunctionIndex)); |
+} |
+ |
+ |
+void BindingsArray::set_bound_function(JSReceiver* function) { |
+ set(kBoundFunctionIndex, function); |
+} |
+ |
+ |
+Object* BindingsArray::bound_this() const { return get(kBoundThisIndex); } |
+ |
+ |
+void BindingsArray::set_bound_this(Object* bound_this) { |
+ set(kBoundThisIndex, bound_this); |
+} |
+ |
+ |
+Object* BindingsArray::binding(int binding_index) const { |
+ return get(kFirstBindingIndex + binding_index); |
+} |
+ |
+ |
+void BindingsArray::set_binding(int binding_index, Object* binding) { |
+ set(kFirstBindingIndex + binding_index, binding); |
+} |
+ |
+ |
+int BindingsArray::bindings_count() const { |
+ return length() - kFirstBindingIndex; |
+} |
+ |
+ |
void HandlerTable::SetRangeStart(int index, int value) { |
set(index * kRangeEntrySize + kRangeStartIndex, Smi::FromInt(value)); |
} |
@@ -6322,13 +6392,13 @@ void JSFunction::set_literals(LiteralsArray* literals) { |
} |
-FixedArray* JSFunction::function_bindings() { |
+BindingsArray* JSFunction::function_bindings() { |
DCHECK(shared()->bound()); |
- return literals_or_bindings(); |
+ return BindingsArray::cast(literals_or_bindings()); |
} |
-void JSFunction::set_function_bindings(FixedArray* bindings) { |
+void JSFunction::set_function_bindings(BindingsArray* bindings) { |
DCHECK(shared()->bound()); |
// Bound function literal may be initialized to the empty fixed array |
// before the bindings are set. |