OLD | NEW |
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreAccumulatorInRegister( | 148 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreAccumulatorInRegister( |
149 Register reg) { | 149 Register reg) { |
150 Output(Bytecode::kStar, reg.ToOperand()); | 150 Output(Bytecode::kStar, reg.ToOperand()); |
151 return *this; | 151 return *this; |
152 } | 152 } |
153 | 153 |
154 | 154 |
| 155 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(int slot_index) { |
| 156 DCHECK(slot_index >= 0); |
| 157 if (FitsInByteOperand(slot_index)) { |
| 158 Output(Bytecode::kLdaGlobal, static_cast<uint8_t>(slot_index)); |
| 159 } else { |
| 160 UNIMPLEMENTED(); |
| 161 } |
| 162 return *this; |
| 163 } |
| 164 |
155 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty( | 165 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty( |
156 Register object, int feedback_slot, LanguageMode language_mode) { | 166 Register object, int feedback_slot, LanguageMode language_mode) { |
157 if (!is_sloppy(language_mode)) { | 167 if (!is_sloppy(language_mode)) { |
158 UNIMPLEMENTED(); | 168 UNIMPLEMENTED(); |
159 } | 169 } |
160 | 170 |
161 if (FitsInByteOperand(feedback_slot)) { | 171 if (FitsInByteOperand(feedback_slot)) { |
162 Output(Bytecode::kLoadIC, object.ToOperand(), | 172 Output(Bytecode::kLoadIC, object.ToOperand(), |
163 static_cast<uint8_t>(feedback_slot)); | 173 static_cast<uint8_t>(feedback_slot)); |
164 } else { | 174 } else { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 392 |
383 Register TemporaryRegisterScope::NewRegister() { | 393 Register TemporaryRegisterScope::NewRegister() { |
384 count_++; | 394 count_++; |
385 last_register_index_ = builder_->BorrowTemporaryRegister(); | 395 last_register_index_ = builder_->BorrowTemporaryRegister(); |
386 return Register(last_register_index_); | 396 return Register(last_register_index_); |
387 } | 397 } |
388 | 398 |
389 } // namespace interpreter | 399 } // namespace interpreter |
390 } // namespace internal | 400 } // namespace internal |
391 } // namespace v8 | 401 } // namespace v8 |
OLD | NEW |