Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index c579d373f7207416134bfd8d47dd7f8a539c9e90..a8163a5f956a17e6b15cf897689d233303fd134f 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -3311,7 +3311,7 @@ ACCESSORS(Map, prototype_transitions, FixedArray, kPrototypeTransitionsOffset) |
ACCESSORS(Map, constructor, Object, kConstructorOffset) |
ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) |
-ACCESSORS(JSFunction, literals, FixedArray, kLiteralsOffset) |
+ACCESSORS(JSFunction, literals_or_bindings, FixedArray, kLiteralsOffset) |
ACCESSORS(JSFunction, |
next_function_link, |
Object, |
@@ -3830,7 +3830,36 @@ bool JSFunction::is_compiled() { |
} |
+FixedArray* JSFunction::literals() { |
+ ASSERT(!shared()->bound()); |
+ return literals_or_bindings(); |
+} |
+ |
+ |
+void JSFunction::set_literals(FixedArray* literals) { |
+ ASSERT(!shared()->bound()); |
+ set_literals_or_bindings(literals); |
+} |
+ |
+ |
+FixedArray* JSFunction::function_bindings() { |
+ ASSERT(shared()->bound()); |
+ return literals_or_bindings(); |
+} |
+ |
+ |
+void JSFunction::set_function_bindings(FixedArray* bindings) { |
+ ASSERT(shared()->bound()); |
+ // Bound function literal may be initialized to the empty fixed array |
+ // before the bindings are set. |
+ ASSERT(bindings == GetHeap()->empty_fixed_array() || |
+ bindings->map() == GetHeap()->fixed_cow_array_map()); |
+ set_literals_or_bindings(bindings); |
+} |
+ |
+ |
int JSFunction::NumberOfLiterals() { |
+ ASSERT(!shared()->bound()); |
return literals()->length(); |
} |