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

Side by Side Diff: src/interpreter/bytecode-array-builder.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.h ('k') | src/interpreter/bytecode-generator.cc » ('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-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace interpreter { 9 namespace interpreter {
10 10
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather 456 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather
457 // than having two different bytecodes once we have better support for 457 // than having two different bytecodes once we have better support for
458 // branches in the InterpreterAssembler. 458 // branches in the InterpreterAssembler.
459 Bytecode bytecode = BytecodeForCreateArguments(type); 459 Bytecode bytecode = BytecodeForCreateArguments(type);
460 Output(bytecode); 460 Output(bytecode);
461 return *this; 461 return *this;
462 } 462 }
463 463
464 464
465 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral( 465 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral(
466 int literal_index, Register flags) { 466 int literal_index, int flags) {
467 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits.
467 if (FitsInIdx8Operand(literal_index)) { 468 if (FitsInIdx8Operand(literal_index)) {
468 Output(Bytecode::kCreateRegExpLiteral, static_cast<uint8_t>(literal_index), 469 Output(Bytecode::kCreateRegExpLiteral, static_cast<uint8_t>(literal_index),
469 flags.ToOperand()); 470 static_cast<uint8_t>(flags));
470 } else { 471 } else {
471 UNIMPLEMENTED(); 472 UNIMPLEMENTED();
472 } 473 }
473 return *this; 474 return *this;
474 } 475 }
475 476
476 477
477 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral( 478 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral(
478 int literal_index, int flags) { 479 int literal_index, int flags) {
479 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits. 480 DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits.
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 DCHECK_GT(next_consecutive_count_, 0); 1331 DCHECK_GT(next_consecutive_count_, 0);
1331 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); 1332 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_);
1332 allocated_.push_back(next_consecutive_register_); 1333 allocated_.push_back(next_consecutive_register_);
1333 next_consecutive_count_--; 1334 next_consecutive_count_--;
1334 return Register(next_consecutive_register_++); 1335 return Register(next_consecutive_register_++);
1335 } 1336 }
1336 1337
1337 } // namespace interpreter 1338 } // namespace interpreter
1338 } // namespace internal 1339 } // namespace internal
1339 } // namespace v8 1340 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698