| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
| 10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 324 |
| 325 #define ASSEMBLE_UNOP(asm_instr) \ | 325 #define ASSEMBLE_UNOP(asm_instr) \ |
| 326 do { \ | 326 do { \ |
| 327 if (instr->Output()->IsRegister()) { \ | 327 if (instr->Output()->IsRegister()) { \ |
| 328 __ asm_instr(i.OutputRegister()); \ | 328 __ asm_instr(i.OutputRegister()); \ |
| 329 } else { \ | 329 } else { \ |
| 330 __ asm_instr(i.OutputOperand()); \ | 330 __ asm_instr(i.OutputOperand()); \ |
| 331 } \ | 331 } \ |
| 332 } while (0) | 332 } while (0) |
| 333 | 333 |
| 334 | 334 #define ASSEMBLE_BINOP(asm_instr) \ |
| 335 #define ASSEMBLE_BINOP(asm_instr) \ | 335 do { \ |
| 336 do { \ | 336 if (AddressingModeField::decode(instr->opcode()) != kMode_None) { \ |
| 337 if (HasImmediateInput(instr, 1)) { \ | 337 size_t index = 1; \ |
| 338 if (instr->InputAt(0)->IsRegister()) { \ | 338 Operand right = i.MemoryOperand(&index); \ |
| 339 __ asm_instr(i.InputRegister(0), i.InputImmediate(1)); \ | 339 __ asm_instr(i.InputRegister(0), right); \ |
| 340 } else { \ | 340 } else { \ |
| 341 __ asm_instr(i.InputOperand(0), i.InputImmediate(1)); \ | 341 if (HasImmediateInput(instr, 1)) { \ |
| 342 } \ | 342 if (instr->InputAt(0)->IsRegister()) { \ |
| 343 } else { \ | 343 __ asm_instr(i.InputRegister(0), i.InputImmediate(1)); \ |
| 344 if (instr->InputAt(1)->IsRegister()) { \ | 344 } else { \ |
| 345 __ asm_instr(i.InputRegister(0), i.InputRegister(1)); \ | 345 __ asm_instr(i.InputOperand(0), i.InputImmediate(1)); \ |
| 346 } else { \ | 346 } \ |
| 347 __ asm_instr(i.InputRegister(0), i.InputOperand(1)); \ | 347 } else { \ |
| 348 } \ | 348 if (instr->InputAt(1)->IsRegister()) { \ |
| 349 } \ | 349 __ asm_instr(i.InputRegister(0), i.InputRegister(1)); \ |
| 350 } else { \ |
| 351 __ asm_instr(i.InputRegister(0), i.InputOperand(1)); \ |
| 352 } \ |
| 353 } \ |
| 354 } \ |
| 350 } while (0) | 355 } while (0) |
| 351 | 356 |
| 352 #define ASSEMBLE_COMPARE(asm_instr) \ | 357 #define ASSEMBLE_COMPARE(asm_instr) \ |
| 353 do { \ | 358 do { \ |
| 354 if (AddressingModeField::decode(instr->opcode()) != kMode_None) { \ | 359 if (AddressingModeField::decode(instr->opcode()) != kMode_None) { \ |
| 355 size_t index = 0; \ | 360 size_t index = 0; \ |
| 356 Operand left = i.MemoryOperand(&index); \ | 361 Operand left = i.MemoryOperand(&index); \ |
| 357 if (HasImmediateInput(instr, index)) { \ | 362 if (HasImmediateInput(instr, index)) { \ |
| 358 __ asm_instr(left, i.InputImmediate(index)); \ | 363 __ asm_instr(left, i.InputImmediate(index)); \ |
| 359 } else { \ | 364 } else { \ |
| (...skipping 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2873 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2878 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 2874 __ Nop(padding_size); | 2879 __ Nop(padding_size); |
| 2875 } | 2880 } |
| 2876 } | 2881 } |
| 2877 | 2882 |
| 2878 #undef __ | 2883 #undef __ |
| 2879 | 2884 |
| 2880 } // namespace compiler | 2885 } // namespace compiler |
| 2881 } // namespace internal | 2886 } // namespace internal |
| 2882 } // namespace v8 | 2887 } // namespace v8 |
| OLD | NEW |