Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: src/objects-inl.h

Issue 1374723002: Introduce LiteralsArray to hide it's implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix build break. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 511d303f9046edf3f975c300346f1343b3c2f2eb..3d39278cce9bd49437e76764f577900cdedb9ad0 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -730,6 +730,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;
@@ -3454,6 +3457,55 @@ void DeoptimizationOutputData::SetPcAndState(int index, Smi* offset) {
}
+Object* LiteralsArray::get(int index) const { return FixedArray::get(index); }
+
+
+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));
+}
+
+
+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));
}
@@ -6258,13 +6310,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);
}
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698