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

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

Issue 1845223006: [Interpreter] Handles legacy constants in strict mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 builder() 2027 builder()
2028 ->JumpIfNotHole(&end_label) 2028 ->JumpIfNotHole(&end_label)
2029 .LoadAccumulatorWithRegister(value_temp) 2029 .LoadAccumulatorWithRegister(value_temp)
2030 .StoreContextSlot(context_reg, variable->index()) 2030 .StoreContextSlot(context_reg, variable->index())
2031 .Bind(&end_label); 2031 .Bind(&end_label);
2032 builder()->LoadAccumulatorWithRegister(value_temp); 2032 builder()->LoadAccumulatorWithRegister(value_temp);
2033 // Break here because the value should not be stored unconditionally. 2033 // Break here because the value should not be stored unconditionally.
2034 // The above code performs the store conditionally. 2034 // The above code performs the store conditionally.
2035 break; 2035 break;
2036 } else if (mode == CONST_LEGACY && op != Token::INIT) { 2036 } else if (mode == CONST_LEGACY && op != Token::INIT) {
2037 DCHECK(!is_strict(language_mode()));
2038 // Ensure accumulator is in the correct state. 2037 // Ensure accumulator is in the correct state.
2039 builder()->LoadAccumulatorWithRegister(value_temp); 2038 builder()->LoadAccumulatorWithRegister(value_temp);
2040 // Break here, non-initializing assignments to legacy constants are 2039 // Break here, non-initializing assignments to legacy constants are
2041 // ignored. 2040 // ignored.
2042 break; 2041 break;
2043 } else { 2042 } else {
2044 BuildHoleCheckForVariableAssignment(variable, op); 2043 BuildHoleCheckForVariableAssignment(variable, op);
2045 builder()->LoadAccumulatorWithRegister(value_temp); 2044 builder()->LoadAccumulatorWithRegister(value_temp);
2046 } 2045 }
2047 } 2046 }
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
3147 } 3146 }
3148 3147
3149 3148
3150 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 3149 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
3151 return info()->feedback_vector()->GetIndex(slot); 3150 return info()->feedback_vector()->GetIndex(slot);
3152 } 3151 }
3153 3152
3154 } // namespace interpreter 3153 } // namespace interpreter
3155 } // namespace internal 3154 } // namespace internal
3156 } // namespace v8 3155 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698