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

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

Issue 1410853002: [Interpreter] Add support for RegExp literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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-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 <stack> 7 #include <stack>
8 8
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/interpreter/control-flow-builders.h" 10 #include "src/interpreter/control-flow-builders.h"
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 builder()->LoadNull(); 496 builder()->LoadNull();
497 } else if (value->IsTheHole()) { 497 } else if (value->IsTheHole()) {
498 builder()->LoadTheHole(); 498 builder()->LoadTheHole();
499 } else { 499 } else {
500 builder()->LoadLiteral(value); 500 builder()->LoadLiteral(value);
501 } 501 }
502 } 502 }
503 503
504 504
505 void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { 505 void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
506 UNIMPLEMENTED(); 506 // Materialize a regular expression literal.
507 TemporaryRegisterScope temporary_register_scope(builder());
508 Register flags = temporary_register_scope.NewRegister();
509 builder()
510 ->LoadLiteral(expr->flags())
511 .StoreAccumulatorInRegister(flags)
512 .LoadLiteral(expr->pattern())
513 .CreateRegExpLiteral(expr->literal_index(), flags);
507 } 514 }
508 515
509 516
510 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { 517 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
511 // Deep-copy the literal boilerplate. 518 // Deep-copy the literal boilerplate.
512 builder() 519 builder()
513 ->LoadLiteral(expr->constant_properties()) 520 ->LoadLiteral(expr->constant_properties())
514 .CreateObjectLiteral(expr->literal_index(), expr->ComputeFlags(true)); 521 .CreateObjectLiteral(expr->literal_index(), expr->ComputeFlags(true));
515 522
516 TemporaryRegisterScope temporary_register_scope(builder()); 523 TemporaryRegisterScope temporary_register_scope(builder());
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 } 1272 }
1266 1273
1267 1274
1268 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 1275 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
1269 return info()->feedback_vector()->GetIndex(slot); 1276 return info()->feedback_vector()->GetIndex(slot);
1270 } 1277 }
1271 1278
1272 } // namespace interpreter 1279 } // namespace interpreter
1273 } // namespace internal 1280 } // namespace internal
1274 } // namespace v8 1281 } // 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