| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/compiler/code-generator-impl.h" | 6 #include "src/compiler/code-generator-impl.h" |
| 7 #include "src/compiler/gap-resolver.h" | 7 #include "src/compiler/gap-resolver.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/osr.h" | 9 #include "src/compiler/osr.h" |
| 10 #include "src/mips/macro-assembler-mips.h" | 10 #include "src/mips/macro-assembler-mips.h" |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } // namespace | 297 } // namespace |
| 298 | 298 |
| 299 | 299 |
| 300 #define ASSEMBLE_CHECKED_LOAD_FLOAT(width, asm_instr) \ | 300 #define ASSEMBLE_CHECKED_LOAD_FLOAT(width, asm_instr) \ |
| 301 do { \ | 301 do { \ |
| 302 auto result = i.Output##width##Register(); \ | 302 auto result = i.Output##width##Register(); \ |
| 303 auto ool = new (zone()) OutOfLineLoad##width(this, result); \ | 303 auto ool = new (zone()) OutOfLineLoad##width(this, result); \ |
| 304 if (instr->InputAt(0)->IsRegister()) { \ | 304 if (instr->InputAt(0)->IsRegister()) { \ |
| 305 auto offset = i.InputRegister(0); \ | 305 auto offset = i.InputRegister(0); \ |
| 306 __ Branch(USE_DELAY_SLOT, ool->entry(), hs, offset, i.InputOperand(1)); \ | 306 __ Branch(USE_DELAY_SLOT, ool->entry(), hs, offset, i.InputOperand(1)); \ |
| 307 __ addu(at, i.InputRegister(2), offset); \ | 307 __ addu(kScratchReg, i.InputRegister(2), offset); \ |
| 308 __ asm_instr(result, MemOperand(at, 0)); \ | 308 __ asm_instr(result, MemOperand(kScratchReg, 0)); \ |
| 309 } else { \ | 309 } else { \ |
| 310 auto offset = i.InputOperand(0).immediate(); \ | 310 auto offset = i.InputOperand(0).immediate(); \ |
| 311 __ Branch(ool->entry(), ls, i.InputRegister(1), Operand(offset)); \ | 311 __ Branch(ool->entry(), ls, i.InputRegister(1), Operand(offset)); \ |
| 312 __ asm_instr(result, MemOperand(i.InputRegister(2), offset)); \ | 312 __ asm_instr(result, MemOperand(i.InputRegister(2), offset)); \ |
| 313 } \ | 313 } \ |
| 314 __ bind(ool->exit()); \ | 314 __ bind(ool->exit()); \ |
| 315 } while (0) | 315 } while (0) |
| 316 | 316 |
| 317 | 317 |
| 318 #define ASSEMBLE_CHECKED_LOAD_INTEGER(asm_instr) \ | 318 #define ASSEMBLE_CHECKED_LOAD_INTEGER(asm_instr) \ |
| 319 do { \ | 319 do { \ |
| 320 auto result = i.OutputRegister(); \ | 320 auto result = i.OutputRegister(); \ |
| 321 auto ool = new (zone()) OutOfLineLoadInteger(this, result); \ | 321 auto ool = new (zone()) OutOfLineLoadInteger(this, result); \ |
| 322 if (instr->InputAt(0)->IsRegister()) { \ | 322 if (instr->InputAt(0)->IsRegister()) { \ |
| 323 auto offset = i.InputRegister(0); \ | 323 auto offset = i.InputRegister(0); \ |
| 324 __ Branch(USE_DELAY_SLOT, ool->entry(), hs, offset, i.InputOperand(1)); \ | 324 __ Branch(USE_DELAY_SLOT, ool->entry(), hs, offset, i.InputOperand(1)); \ |
| 325 __ addu(at, i.InputRegister(2), offset); \ | 325 __ addu(kScratchReg, i.InputRegister(2), offset); \ |
| 326 __ asm_instr(result, MemOperand(at, 0)); \ | 326 __ asm_instr(result, MemOperand(kScratchReg, 0)); \ |
| 327 } else { \ | 327 } else { \ |
| 328 auto offset = i.InputOperand(0).immediate(); \ | 328 auto offset = i.InputOperand(0).immediate(); \ |
| 329 __ Branch(ool->entry(), ls, i.InputRegister(1), Operand(offset)); \ | 329 __ Branch(ool->entry(), ls, i.InputRegister(1), Operand(offset)); \ |
| 330 __ asm_instr(result, MemOperand(i.InputRegister(2), offset)); \ | 330 __ asm_instr(result, MemOperand(i.InputRegister(2), offset)); \ |
| 331 } \ | 331 } \ |
| 332 __ bind(ool->exit()); \ | 332 __ bind(ool->exit()); \ |
| 333 } while (0) | 333 } while (0) |
| 334 | 334 |
| 335 | 335 |
| 336 #define ASSEMBLE_CHECKED_STORE_FLOAT(width, asm_instr) \ | 336 #define ASSEMBLE_CHECKED_STORE_FLOAT(width, asm_instr) \ |
| 337 do { \ | 337 do { \ |
| 338 Label done; \ | 338 Label done; \ |
| 339 if (instr->InputAt(0)->IsRegister()) { \ | 339 if (instr->InputAt(0)->IsRegister()) { \ |
| 340 auto offset = i.InputRegister(0); \ | 340 auto offset = i.InputRegister(0); \ |
| 341 auto value = i.Input##width##Register(2); \ | 341 auto value = i.Input##width##Register(2); \ |
| 342 __ Branch(USE_DELAY_SLOT, &done, hs, offset, i.InputOperand(1)); \ | 342 __ Branch(USE_DELAY_SLOT, &done, hs, offset, i.InputOperand(1)); \ |
| 343 __ addu(at, i.InputRegister(3), offset); \ | 343 __ addu(kScratchReg, i.InputRegister(3), offset); \ |
| 344 __ asm_instr(value, MemOperand(at, 0)); \ | 344 __ asm_instr(value, MemOperand(kScratchReg, 0)); \ |
| 345 } else { \ | 345 } else { \ |
| 346 auto offset = i.InputOperand(0).immediate(); \ | 346 auto offset = i.InputOperand(0).immediate(); \ |
| 347 auto value = i.Input##width##Register(2); \ | 347 auto value = i.Input##width##Register(2); \ |
| 348 __ Branch(&done, ls, i.InputRegister(1), Operand(offset)); \ | 348 __ Branch(&done, ls, i.InputRegister(1), Operand(offset)); \ |
| 349 __ asm_instr(value, MemOperand(i.InputRegister(3), offset)); \ | 349 __ asm_instr(value, MemOperand(i.InputRegister(3), offset)); \ |
| 350 } \ | 350 } \ |
| 351 __ bind(&done); \ | 351 __ bind(&done); \ |
| 352 } while (0) | 352 } while (0) |
| 353 | 353 |
| 354 | 354 |
| 355 #define ASSEMBLE_CHECKED_STORE_INTEGER(asm_instr) \ | 355 #define ASSEMBLE_CHECKED_STORE_INTEGER(asm_instr) \ |
| 356 do { \ | 356 do { \ |
| 357 Label done; \ | 357 Label done; \ |
| 358 if (instr->InputAt(0)->IsRegister()) { \ | 358 if (instr->InputAt(0)->IsRegister()) { \ |
| 359 auto offset = i.InputRegister(0); \ | 359 auto offset = i.InputRegister(0); \ |
| 360 auto value = i.InputRegister(2); \ | 360 auto value = i.InputRegister(2); \ |
| 361 __ Branch(USE_DELAY_SLOT, &done, hs, offset, i.InputOperand(1)); \ | 361 __ Branch(USE_DELAY_SLOT, &done, hs, offset, i.InputOperand(1)); \ |
| 362 __ addu(at, i.InputRegister(3), offset); \ | 362 __ addu(kScratchReg, i.InputRegister(3), offset); \ |
| 363 __ asm_instr(value, MemOperand(at, 0)); \ | 363 __ asm_instr(value, MemOperand(kScratchReg, 0)); \ |
| 364 } else { \ | 364 } else { \ |
| 365 auto offset = i.InputOperand(0).immediate(); \ | 365 auto offset = i.InputOperand(0).immediate(); \ |
| 366 auto value = i.InputRegister(2); \ | 366 auto value = i.InputRegister(2); \ |
| 367 __ Branch(&done, ls, i.InputRegister(1), Operand(offset)); \ | 367 __ Branch(&done, ls, i.InputRegister(1), Operand(offset)); \ |
| 368 __ asm_instr(value, MemOperand(i.InputRegister(3), offset)); \ | 368 __ asm_instr(value, MemOperand(i.InputRegister(3), offset)); \ |
| 369 } \ | 369 } \ |
| 370 __ bind(&done); \ | 370 __ bind(&done); \ |
| 371 } while (0) | 371 } while (0) |
| 372 | 372 |
| 373 | 373 |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 padding_size -= v8::internal::Assembler::kInstrSize; | 1440 padding_size -= v8::internal::Assembler::kInstrSize; |
| 1441 } | 1441 } |
| 1442 } | 1442 } |
| 1443 } | 1443 } |
| 1444 | 1444 |
| 1445 #undef __ | 1445 #undef __ |
| 1446 | 1446 |
| 1447 } // namespace compiler | 1447 } // namespace compiler |
| 1448 } // namespace internal | 1448 } // namespace internal |
| 1449 } // namespace v8 | 1449 } // namespace v8 |
| OLD | NEW |