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/bytecodes.h" | 5 #include "src/interpreter/bytecodes.h" |
6 | 6 |
7 #include "src/frames.h" | 7 #include "src/frames.h" |
8 #include "src/interpreter/bytecode-traits.h" | 8 #include "src/interpreter/bytecode-traits.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 int Register::MaxParameterIndex() { return kMaxParameterIndex; } | 322 int Register::MaxParameterIndex() { return kMaxParameterIndex; } |
323 | 323 |
324 | 324 |
325 uint8_t Register::ToOperand() const { return static_cast<uint8_t>(-index_); } | 325 uint8_t Register::ToOperand() const { return static_cast<uint8_t>(-index_); } |
326 | 326 |
327 | 327 |
328 Register Register::FromOperand(uint8_t operand) { | 328 Register Register::FromOperand(uint8_t operand) { |
329 return Register(-static_cast<int8_t>(operand)); | 329 return Register(-static_cast<int8_t>(operand)); |
330 } | 330 } |
331 | 331 |
| 332 |
| 333 bool Register::AreContiguous(Register reg1, Register reg2, Register reg3, |
| 334 Register reg4, Register reg5) { |
| 335 if (reg1.index() + 1 != reg2.index()) { |
| 336 return false; |
| 337 } |
| 338 if (reg3.is_valid() && reg2.index() + 1 != reg3.index()) { |
| 339 return false; |
| 340 } |
| 341 if (reg4.is_valid() && reg3.index() + 1 != reg4.index()) { |
| 342 return false; |
| 343 } |
| 344 if (reg5.is_valid() && reg4.index() + 1 != reg5.index()) { |
| 345 return false; |
| 346 } |
| 347 return true; |
| 348 } |
| 349 |
332 } // namespace interpreter | 350 } // namespace interpreter |
333 } // namespace internal | 351 } // namespace internal |
334 } // namespace v8 | 352 } // namespace v8 |
OLD | NEW |