| OLD | NEW |
| 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 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1873 break; | 1873 break; |
| 1874 } | 1874 } |
| 1875 } | 1875 } |
| 1876 | 1876 |
| 1877 execution_result()->SetResultInRegister(literal); | 1877 execution_result()->SetResultInRegister(literal); |
| 1878 } | 1878 } |
| 1879 | 1879 |
| 1880 void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1880 void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
| 1881 // Deep-copy the literal boilerplate. | 1881 // Deep-copy the literal boilerplate. |
| 1882 builder()->CreateArrayLiteral(expr->constant_elements(), | 1882 builder()->CreateArrayLiteral(expr->constant_elements(), |
| 1883 expr->literal_index(), | 1883 expr->literal_index(), expr->ComputeFlags()); |
| 1884 expr->ComputeFlags(true)); | |
| 1885 Register index, literal; | 1884 Register index, literal; |
| 1886 | 1885 |
| 1887 // Evaluate all the non-constant subexpressions and store them into the | 1886 // Evaluate all the non-constant subexpressions and store them into the |
| 1888 // newly cloned array. | 1887 // newly cloned array. |
| 1889 bool literal_in_accumulator = true; | 1888 bool literal_in_accumulator = true; |
| 1890 for (int array_index = 0; array_index < expr->values()->length(); | 1889 for (int array_index = 0; array_index < expr->values()->length(); |
| 1891 array_index++) { | 1890 array_index++) { |
| 1892 Expression* subexpr = expr->values()->at(array_index); | 1891 Expression* subexpr = expr->values()->at(array_index); |
| 1893 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 1892 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
| 1894 DCHECK(!subexpr->IsSpread()); | 1893 DCHECK(!subexpr->IsSpread()); |
| (...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3394 return execution_context()->scope()->language_mode(); | 3393 return execution_context()->scope()->language_mode(); |
| 3395 } | 3394 } |
| 3396 | 3395 |
| 3397 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3396 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 3398 return TypeFeedbackVector::GetIndex(slot); | 3397 return TypeFeedbackVector::GetIndex(slot); |
| 3399 } | 3398 } |
| 3400 | 3399 |
| 3401 } // namespace interpreter | 3400 } // namespace interpreter |
| 3402 } // namespace internal | 3401 } // namespace internal |
| 3403 } // namespace v8 | 3402 } // namespace v8 |
| OLD | NEW |