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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/interpreter/bytecode-flags.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/interpreter/bytecode-generator.h" 5 #include "src/interpreter/bytecode-generator.h"
6 6
7 #include "src/ast/compile-time-value.h" 7 #include "src/ast/compile-time-value.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-info.h" 10 #include "src/compilation-info.h"
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 literal_argument, 4); 1869 literal_argument, 4);
1870 break; 1870 break;
1871 } 1871 }
1872 } 1872 }
1873 1873
1874 execution_result()->SetResultInRegister(literal); 1874 execution_result()->SetResultInRegister(literal);
1875 } 1875 }
1876 1876
1877 void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { 1877 void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
1878 // Deep-copy the literal boilerplate. 1878 // Deep-copy the literal boilerplate.
1879 int runtime_flags = expr->ComputeFlags();
1880 bool use_fast_shallow_clone =
1881 (runtime_flags & ArrayLiteral::kShallowElements) != 0 &&
1882 expr->values()->length() <= JSArray::kInitialMaxFastElementArray;
1883 uint8_t flags =
1884 CreateArrayLiteralFlags::Encode(use_fast_shallow_clone, runtime_flags);
1879 builder()->CreateArrayLiteral(expr->constant_elements(), 1885 builder()->CreateArrayLiteral(expr->constant_elements(),
1880 expr->literal_index(), expr->ComputeFlags()); 1886 expr->literal_index(), flags);
1881 Register index, literal; 1887 Register index, literal;
1882 1888
1883 // Evaluate all the non-constant subexpressions and store them into the 1889 // Evaluate all the non-constant subexpressions and store them into the
1884 // newly cloned array. 1890 // newly cloned array.
1885 bool literal_in_accumulator = true; 1891 bool literal_in_accumulator = true;
1886 for (int array_index = 0; array_index < expr->values()->length(); 1892 for (int array_index = 0; array_index < expr->values()->length();
1887 array_index++) { 1893 array_index++) {
1888 Expression* subexpr = expr->values()->at(array_index); 1894 Expression* subexpr = expr->values()->at(array_index);
1889 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; 1895 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
1890 DCHECK(!subexpr->IsSpread()); 1896 DCHECK(!subexpr->IsSpread());
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
3444 return execution_context()->scope()->language_mode(); 3450 return execution_context()->scope()->language_mode();
3445 } 3451 }
3446 3452
3447 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 3453 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
3448 return TypeFeedbackVector::GetIndex(slot); 3454 return TypeFeedbackVector::GetIndex(slot);
3449 } 3455 }
3450 3456
3451 } // namespace interpreter 3457 } // namespace interpreter
3452 } // namespace internal 3458 } // namespace internal
3453 } // namespace v8 3459 } // namespace v8
OLDNEW
« 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