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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreAccumulatorInRegister( | 248 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreAccumulatorInRegister( |
249 Register reg) { | 249 Register reg) { |
250 Output(Bytecode::kStar, reg.ToOperand()); | 250 Output(Bytecode::kStar, reg.ToOperand()); |
251 return *this; | 251 return *this; |
252 } | 252 } |
253 | 253 |
254 | 254 |
255 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(int slot_index) { | 255 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(int slot_index) { |
256 DCHECK(slot_index >= 0); | 256 DCHECK(slot_index >= 0); |
257 if (FitsInIdx8Operand(slot_index)) { | 257 if (FitsInIdx16Operand(slot_index)) { |
258 Output(Bytecode::kLdaGlobal, static_cast<uint8_t>(slot_index)); | 258 Output(Bytecode::kLdaGlobal, static_cast<uint16_t>(slot_index)); |
259 } else { | 259 } else { |
260 UNIMPLEMENTED(); | 260 UNIMPLEMENTED(); |
261 } | 261 } |
262 return *this; | 262 return *this; |
263 } | 263 } |
264 | 264 |
265 | 265 |
266 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreGlobal( | 266 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreGlobal( |
267 int slot_index, LanguageMode language_mode) { | 267 int slot_index, LanguageMode language_mode) { |
268 DCHECK(slot_index >= 0); | 268 DCHECK(slot_index >= 0); |
269 Bytecode bytecode = BytecodeForStoreGlobal(language_mode); | 269 Bytecode bytecode = BytecodeForStoreGlobal(language_mode); |
270 if (FitsInIdx8Operand(slot_index)) { | 270 if (FitsInIdx16Operand(slot_index)) { |
271 Output(bytecode, static_cast<uint8_t>(slot_index)); | 271 Output(bytecode, static_cast<uint8_t>(slot_index)); |
272 } else { | 272 } else { |
273 UNIMPLEMENTED(); | 273 UNIMPLEMENTED(); |
274 } | 274 } |
275 return *this; | 275 return *this; |
276 } | 276 } |
277 | 277 |
278 | 278 |
279 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadContextSlot(Register context, | 279 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadContextSlot(Register context, |
280 int slot_index) { | 280 int slot_index) { |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 | 860 |
861 Register TemporaryRegisterScope::NewRegister() { | 861 Register TemporaryRegisterScope::NewRegister() { |
862 count_++; | 862 count_++; |
863 last_register_index_ = builder_->BorrowTemporaryRegister(); | 863 last_register_index_ = builder_->BorrowTemporaryRegister(); |
864 return Register(last_register_index_); | 864 return Register(last_register_index_); |
865 } | 865 } |
866 | 866 |
867 } // namespace interpreter | 867 } // namespace interpreter |
868 } // namespace internal | 868 } // namespace internal |
869 } // namespace v8 | 869 } // namespace v8 |
OLD | NEW |