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

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

Issue 1294793002: [Interpreter] Add implementations for load immediate bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@interpreter_accum
Patch Set: Created 5 years, 4 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 Output(BytecodeForBinaryOperation(binop), reg.ToOperand()); 43 Output(BytecodeForBinaryOperation(binop), reg.ToOperand());
44 return *this; 44 return *this;
45 } 45 }
46 46
47 47
48 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLiteral( 48 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLiteral(
49 v8::internal::Smi* smi) { 49 v8::internal::Smi* smi) {
50 int32_t raw_smi = smi->value(); 50 int32_t raw_smi = smi->value();
51 if (raw_smi == 0) { 51 if (raw_smi == 0) {
52 Output(Bytecode::kLdaZero); 52 Output(Bytecode::kLdaZero);
53 } else if (raw_smi > -128 && raw_smi <= 128) { 53 } else if (raw_smi >= -128 && raw_smi < 128) {
54 Output(Bytecode::kLdaSmi8, static_cast<uint8_t>(raw_smi)); 54 Output(Bytecode::kLdaSmi8, static_cast<uint8_t>(raw_smi));
55 } else { 55 } else {
56 // TODO(oth): Put Smi in constant pool. 56 // TODO(oth): Put Smi in constant pool.
57 UNIMPLEMENTED(); 57 UNIMPLEMENTED();
58 } 58 }
59 return *this; 59 return *this;
60 } 60 }
61 61
62 62
63 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadUndefined() { 63 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadUndefined() {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 Register TemporaryRegisterScope::NewRegister() { 214 Register TemporaryRegisterScope::NewRegister() {
215 count_++; 215 count_++;
216 last_register_index_ = builder_->BorrowTemporaryRegister(); 216 last_register_index_ = builder_->BorrowTemporaryRegister();
217 return Register(last_register_index_); 217 return Register(last_register_index_);
218 } 218 }
219 219
220 } // namespace interpreter 220 } // namespace interpreter
221 } // namespace internal 221 } // namespace internal
222 } // namespace v8 222 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698