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

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 1474103002: Re-reland "[Interpreter] Add CreateClosure to BytecodeGraphBuilder." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 Output(BytecodeForWideOperands(bytecode), object.ToOperand(), 437 Output(BytecodeForWideOperands(bytecode), object.ToOperand(),
438 key.ToOperand(), static_cast<uint16_t>(feedback_slot)); 438 key.ToOperand(), static_cast<uint16_t>(feedback_slot));
439 } else { 439 } else {
440 UNIMPLEMENTED(); 440 UNIMPLEMENTED();
441 } 441 }
442 return *this; 442 return *this;
443 } 443 }
444 444
445 445
446 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure( 446 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure(
447 PretenureFlag tenured) { 447 Handle<SharedFunctionInfo> shared_info, PretenureFlag tenured) {
448 size_t entry = GetConstantPoolEntry(shared_info);
448 DCHECK(FitsInImm8Operand(tenured)); 449 DCHECK(FitsInImm8Operand(tenured));
449 Output(Bytecode::kCreateClosure, static_cast<uint8_t>(tenured)); 450 if (FitsInIdx8Operand(entry)) {
451 Output(Bytecode::kCreateClosure, static_cast<uint8_t>(entry),
452 static_cast<uint8_t>(tenured));
453 } else if (FitsInIdx16Operand(entry)) {
454 Output(Bytecode::kCreateClosureWide, static_cast<uint16_t>(entry),
455 static_cast<uint8_t>(tenured));
456 } else {
457 UNIMPLEMENTED();
458 }
450 return *this; 459 return *this;
451 } 460 }
452 461
453 462
454 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments( 463 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments(
455 CreateArgumentsType type) { 464 CreateArgumentsType type) {
456 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather 465 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather
457 // than having two different bytecodes once we have better support for 466 // than having two different bytecodes once we have better support for
458 // branches in the InterpreterAssembler. 467 // branches in the InterpreterAssembler.
459 Bytecode bytecode = BytecodeForCreateArguments(type); 468 Bytecode bytecode = BytecodeForCreateArguments(type);
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 DCHECK_GT(next_consecutive_count_, 0); 1341 DCHECK_GT(next_consecutive_count_, 0);
1333 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); 1342 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_);
1334 allocated_.push_back(next_consecutive_register_); 1343 allocated_.push_back(next_consecutive_register_);
1335 next_consecutive_count_--; 1344 next_consecutive_count_--;
1336 return Register(next_consecutive_register_++); 1345 return Register(next_consecutive_register_++);
1337 } 1346 }
1338 1347
1339 } // namespace interpreter 1348 } // namespace interpreter
1340 } // namespace internal 1349 } // namespace internal
1341 } // namespace v8 1350 } // 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