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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2341743003: [interpreter] Inline FastCloneShallowArrayStub into bytecode handler (Closed)
Patch Set: compile issues Created 4 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
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 53a216ea4c9b66a142f9e34b7c7f447d0bace5a7..2e922530f192746b8d8daf2bf0c1bd970ff496a4 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1876,8 +1876,14 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
// Deep-copy the literal boilerplate.
+ int runtime_flags = expr->ComputeFlags();
+ bool must_use_runtime =
+ (runtime_flags & ArrayLiteral::kShallowElements) == 0 ||
+ expr->values()->length() > JSArray::kInitialMaxFastElementArray;
+ uint8_t flags =
+ CreateArrayLiteralFlags::Encode(must_use_runtime, runtime_flags);
builder()->CreateArrayLiteral(expr->constant_elements(),
- expr->literal_index(), expr->ComputeFlags());
+ expr->literal_index(), flags);
Register index, literal;
// Evaluate all the non-constant subexpressions and store them into the

Powered by Google App Engine
This is Rietveld 408576698