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

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

Issue 1472323002: [es6] Correct parsing of regular expression literal flags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix oversight in interpreter Created 5 years 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-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('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/compiler.h" 7 #include "src/compiler.h"
8 #include "src/interpreter/control-flow-builders.h" 8 #include "src/interpreter/control-flow-builders.h"
9 #include "src/objects.h" 9 #include "src/objects.h"
10 #include "src/parser.h" 10 #include "src/parser.h"
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 builder()->LoadLiteral(value); 1035 builder()->LoadLiteral(value);
1036 } 1036 }
1037 execution_result()->SetResultInAccumulator(); 1037 execution_result()->SetResultInAccumulator();
1038 } 1038 }
1039 } 1039 }
1040 1040
1041 1041
1042 void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { 1042 void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
1043 // Materialize a regular expression literal. 1043 // Materialize a regular expression literal.
1044 TemporaryRegisterScope temporary_register_scope(builder()); 1044 TemporaryRegisterScope temporary_register_scope(builder());
1045 Register flags = temporary_register_scope.NewRegister();
1046 builder() 1045 builder()
1047 ->LoadLiteral(expr->flags()) 1046 ->LoadLiteral(expr->pattern())
1048 .StoreAccumulatorInRegister(flags) 1047 .CreateRegExpLiteral(expr->literal_index(), expr->flags());
1049 .LoadLiteral(expr->pattern())
1050 .CreateRegExpLiteral(expr->literal_index(), flags);
1051 execution_result()->SetResultInAccumulator(); 1048 execution_result()->SetResultInAccumulator();
1052 } 1049 }
1053 1050
1054 1051
1055 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { 1052 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
1056 // Deep-copy the literal boilerplate. 1053 // Deep-copy the literal boilerplate.
1057 builder() 1054 builder()
1058 ->LoadLiteral(expr->constant_properties()) 1055 ->LoadLiteral(expr->constant_properties())
1059 .CreateObjectLiteral(expr->literal_index(), expr->ComputeFlags(true)); 1056 .CreateObjectLiteral(expr->literal_index(), expr->ComputeFlags(true));
1060 1057
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
2230 } 2227 }
2231 2228
2232 2229
2233 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 2230 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
2234 return info()->feedback_vector()->GetIndex(slot); 2231 return info()->feedback_vector()->GetIndex(slot);
2235 } 2232 }
2236 2233
2237 } // namespace interpreter 2234 } // namespace interpreter
2238 } // namespace internal 2235 } // namespace internal
2239 } // namespace v8 2236 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698