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

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

Issue 2341743003: [interpreter] Inline FastCloneShallowArrayStub into bytecode handler (Closed)
Patch Set: rebase 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
« no previous file with comments | « src/interpreter/bytecode-flags.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 3820f4fb5a55a1fc9f6f3415858dee7ba181458a..330e638750bb156d609f16a21819d63b5853493f 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 use_fast_shallow_clone =
+ (runtime_flags & ArrayLiteral::kShallowElements) != 0 &&
+ expr->values()->length() <= JSArray::kInitialMaxFastElementArray;
+ uint8_t flags =
+ CreateArrayLiteralFlags::Encode(use_fast_shallow_clone, 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
« no previous file with comments | « src/interpreter/bytecode-flags.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698