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

Unified Diff: src/ast/ast.h

Issue 2581683003: Introduce {ConstantElementsPair} struct for type safety. (Closed)
Patch Set: Rebased. Created 4 years 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 | « include/v8.h ('k') | src/ast/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index d565c8be402ac17df71c07cf69975bf396c7fe43..2a793f8f3cccb7e5042ea5bf05429597ffc8fe09 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -1540,11 +1540,11 @@ class RegExpLiteral final : public MaterializedLiteral {
// for minimizing the work when constructing it at runtime.
class ArrayLiteral final : public MaterializedLiteral {
public:
- Handle<FixedArray> constant_elements() const { return constant_elements_; }
+ Handle<ConstantElementsPair> constant_elements() const {
+ return constant_elements_;
+ }
ElementsKind constant_elements_kind() const {
- DCHECK_EQ(2, constant_elements_->length());
- return static_cast<ElementsKind>(
- Smi::cast(constant_elements_->get(0))->value());
+ return static_cast<ElementsKind>(constant_elements()->elements_kind());
}
ZoneList<Expression*>* values() const { return values_; }
@@ -1610,7 +1610,7 @@ class ArrayLiteral final : public MaterializedLiteral {
int first_spread_index_;
FeedbackVectorSlot literal_slot_;
- Handle<FixedArray> constant_elements_;
+ Handle<ConstantElementsPair> constant_elements_;
ZoneList<Expression*>* values_;
};
« no previous file with comments | « include/v8.h ('k') | src/ast/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698