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

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

Issue 1396693003: [Interpreter] Add function literal support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_newcontext
Patch Set: Make CreateClosure a bytecode 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
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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 return *this; 347 return *this;
348 } 348 }
349 349
350 350
351 BytecodeArrayBuilder& BytecodeArrayBuilder::PopContext(Register context) { 351 BytecodeArrayBuilder& BytecodeArrayBuilder::PopContext(Register context) {
352 Output(Bytecode::kPopContext, context.ToOperand()); 352 Output(Bytecode::kPopContext, context.ToOperand());
353 return *this; 353 return *this;
354 } 354 }
355 355
356 356
357 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure(
358 PretenureFlag tenured) {
359 DCHECK(FitsInImm8Operand(tenured));
360 Output(Bytecode::kCreateClosure, static_cast<uint8_t>(tenured));
361 return *this;
362 }
363
364
357 BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToBoolean() { 365 BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToBoolean() {
358 if (LastBytecodeInSameBlock()) { 366 if (LastBytecodeInSameBlock()) {
359 // If the previous bytecode puts a boolean in the accumulator 367 // If the previous bytecode puts a boolean in the accumulator
360 // there is no need to emit an instruction. 368 // there is no need to emit an instruction.
361 switch (Bytecodes::FromByte(bytecodes()->at(last_bytecode_start_))) { 369 switch (Bytecodes::FromByte(bytecodes()->at(last_bytecode_start_))) {
362 case Bytecode::kToBoolean: 370 case Bytecode::kToBoolean:
363 UNREACHABLE(); 371 UNREACHABLE();
364 case Bytecode::kLdaTrue: 372 case Bytecode::kLdaTrue:
365 case Bytecode::kLdaFalse: 373 case Bytecode::kLdaFalse:
366 case Bytecode::kLogicalNot: 374 case Bytecode::kLogicalNot:
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 784
777 Register TemporaryRegisterScope::NewRegister() { 785 Register TemporaryRegisterScope::NewRegister() {
778 count_++; 786 count_++;
779 last_register_index_ = builder_->BorrowTemporaryRegister(); 787 last_register_index_ = builder_->BorrowTemporaryRegister();
780 return Register(last_register_index_); 788 return Register(last_register_index_);
781 } 789 }
782 790
783 } // namespace interpreter 791 } // namespace interpreter
784 } // namespace internal 792 } // namespace internal
785 } // namespace v8 793 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698