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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 1592713002: Clean up dead code after spread desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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
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/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/interpreter/bytecode-register-allocator.h" 9 #include "src/interpreter/bytecode-register-allocator.h"
10 #include "src/interpreter/control-flow-builders.h" 10 #include "src/interpreter/control-flow-builders.h"
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 expr->ComputeFlags(true)); 1149 expr->ComputeFlags(true));
1150 Register index, literal; 1150 Register index, literal;
1151 1151
1152 // Evaluate all the non-constant subexpressions and store them into the 1152 // Evaluate all the non-constant subexpressions and store them into the
1153 // newly cloned array. 1153 // newly cloned array.
1154 bool literal_in_accumulator = true; 1154 bool literal_in_accumulator = true;
1155 for (int array_index = 0; array_index < expr->values()->length(); 1155 for (int array_index = 0; array_index < expr->values()->length();
1156 array_index++) { 1156 array_index++) {
1157 Expression* subexpr = expr->values()->at(array_index); 1157 Expression* subexpr = expr->values()->at(array_index);
1158 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; 1158 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
1159 if (subexpr->IsSpread()) { 1159 DCHECK(!subexpr->IsSpread());
1160 // TODO(rmcilroy): Deal with spread expressions.
1161 UNIMPLEMENTED();
1162 }
1163 1160
1164 if (literal_in_accumulator) { 1161 if (literal_in_accumulator) {
1165 index = register_allocator()->NewRegister(); 1162 index = register_allocator()->NewRegister();
1166 literal = register_allocator()->NewRegister(); 1163 literal = register_allocator()->NewRegister();
1167 builder()->StoreAccumulatorInRegister(literal); 1164 builder()->StoreAccumulatorInRegister(literal);
1168 literal_in_accumulator = false; 1165 literal_in_accumulator = false;
1169 } 1166 }
1170 1167
1171 FeedbackVectorSlot slot = expr->LiteralFeedbackSlot(); 1168 FeedbackVectorSlot slot = expr->LiteralFeedbackSlot();
1172 builder() 1169 builder()
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 } 2170 }
2174 2171
2175 2172
2176 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 2173 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
2177 return info()->feedback_vector()->GetIndex(slot); 2174 return info()->feedback_vector()->GetIndex(slot);
2178 } 2175 }
2179 2176
2180 } // namespace interpreter 2177 } // namespace interpreter
2181 } // namespace internal 2178 } // namespace internal
2182 } // namespace v8 2179 } // namespace v8
OLDNEW
« src/ast/ast-literal-reindexer.cc ('K') | « src/full-codegen/x87/full-codegen-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698