| 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 "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 __ add(i.OutputRegister(), Immediate(0x80000000)); | 328 __ add(i.OutputRegister(), Immediate(0x80000000)); |
| 329 break; | 329 break; |
| 330 } | 330 } |
| 331 case kSSEInt32ToFloat64: | 331 case kSSEInt32ToFloat64: |
| 332 __ cvtsi2sd(i.OutputDoubleRegister(), i.InputOperand(0)); | 332 __ cvtsi2sd(i.OutputDoubleRegister(), i.InputOperand(0)); |
| 333 break; | 333 break; |
| 334 case kSSEUint32ToFloat64: | 334 case kSSEUint32ToFloat64: |
| 335 // TODO(turbofan): IA32 SSE LoadUint32() should take an operand. | 335 // TODO(turbofan): IA32 SSE LoadUint32() should take an operand. |
| 336 __ LoadUint32(i.OutputDoubleRegister(), i.InputRegister(0)); | 336 __ LoadUint32(i.OutputDoubleRegister(), i.InputRegister(0)); |
| 337 break; | 337 break; |
| 338 case kSSELoad: | 338 case kIA32Movsxbl: |
| 339 __ movsd(i.OutputDoubleRegister(), i.MemoryOperand()); | 339 __ movsx_b(i.OutputRegister(), i.MemoryOperand()); |
| 340 break; | 340 break; |
| 341 case kSSEStore: { | 341 case kIA32Movzxbl: |
| 342 __ movzx_b(i.OutputRegister(), i.MemoryOperand()); |
| 343 break; |
| 344 case kIA32Movb: { |
| 342 int index = 0; | 345 int index = 0; |
| 343 Operand operand = i.MemoryOperand(&index); | 346 Operand operand = i.MemoryOperand(&index); |
| 344 __ movsd(operand, i.InputDoubleRegister(index)); | 347 if (HasImmediateInput(instr, index)) { |
| 348 __ mov_b(operand, i.InputInt8(index)); |
| 349 } else { |
| 350 __ mov_b(operand, i.InputRegister(index)); |
| 351 } |
| 345 break; | 352 break; |
| 346 } | 353 } |
| 347 case kIA32LoadWord8: | 354 case kIA32Movsxwl: |
| 348 __ movzx_b(i.OutputRegister(), i.MemoryOperand()); | 355 __ movsx_w(i.OutputRegister(), i.MemoryOperand()); |
| 349 break; | 356 break; |
| 350 case kIA32StoreWord8: { | 357 case kIA32Movzxwl: |
| 358 __ movzx_w(i.OutputRegister(), i.MemoryOperand()); |
| 359 break; |
| 360 case kIA32Movw: { |
| 351 int index = 0; | 361 int index = 0; |
| 352 Operand operand = i.MemoryOperand(&index); | 362 Operand operand = i.MemoryOperand(&index); |
| 353 __ mov_b(operand, i.InputRegister(index)); | 363 if (HasImmediateInput(instr, index)) { |
| 364 __ mov_w(operand, i.InputInt16(index)); |
| 365 } else { |
| 366 __ mov_w(operand, i.InputRegister(index)); |
| 367 } |
| 354 break; | 368 break; |
| 355 } | 369 } |
| 356 case kIA32StoreWord8I: { | 370 case kIA32Movl: |
| 357 int index = 0; | 371 if (instr->HasOutput()) { |
| 358 Operand operand = i.MemoryOperand(&index); | 372 __ mov(i.OutputRegister(), i.MemoryOperand()); |
| 359 __ mov_b(operand, i.InputInt8(index)); | 373 } else { |
| 374 int index = 0; |
| 375 Operand operand = i.MemoryOperand(&index); |
| 376 if (HasImmediateInput(instr, index)) { |
| 377 __ mov(operand, i.InputImmediate(index)); |
| 378 } else { |
| 379 __ mov(operand, i.InputRegister(index)); |
| 380 } |
| 381 } |
| 360 break; | 382 break; |
| 361 } | 383 case kIA32Movsd: |
| 362 case kIA32LoadWord16: | 384 if (instr->HasOutput()) { |
| 363 __ movzx_w(i.OutputRegister(), i.MemoryOperand()); | 385 __ movsd(i.OutputDoubleRegister(), i.MemoryOperand()); |
| 386 } else { |
| 387 int index = 0; |
| 388 Operand operand = i.MemoryOperand(&index); |
| 389 __ movsd(operand, i.InputDoubleRegister(index)); |
| 390 } |
| 364 break; | 391 break; |
| 365 case kIA32StoreWord16: { | |
| 366 int index = 0; | |
| 367 Operand operand = i.MemoryOperand(&index); | |
| 368 __ mov_w(operand, i.InputRegister(index)); | |
| 369 break; | |
| 370 } | |
| 371 case kIA32StoreWord16I: { | |
| 372 int index = 0; | |
| 373 Operand operand = i.MemoryOperand(&index); | |
| 374 __ mov_w(operand, i.InputInt16(index)); | |
| 375 break; | |
| 376 } | |
| 377 case kIA32LoadWord32: | |
| 378 __ mov(i.OutputRegister(), i.MemoryOperand()); | |
| 379 break; | |
| 380 case kIA32StoreWord32: { | |
| 381 int index = 0; | |
| 382 Operand operand = i.MemoryOperand(&index); | |
| 383 __ mov(operand, i.InputRegister(index)); | |
| 384 break; | |
| 385 } | |
| 386 case kIA32StoreWord32I: { | |
| 387 int index = 0; | |
| 388 Operand operand = i.MemoryOperand(&index); | |
| 389 __ mov(operand, i.InputImmediate(index)); | |
| 390 break; | |
| 391 } | |
| 392 case kIA32StoreWriteBarrier: { | 392 case kIA32StoreWriteBarrier: { |
| 393 Register object = i.InputRegister(0); | 393 Register object = i.InputRegister(0); |
| 394 Register index = i.InputRegister(1); | 394 Register index = i.InputRegister(1); |
| 395 Register value = i.InputRegister(2); | 395 Register value = i.InputRegister(2); |
| 396 __ mov(Operand(object, index, times_1, 0), value); | 396 __ mov(Operand(object, index, times_1, 0), value); |
| 397 __ lea(index, Operand(object, index, times_1, 0)); | 397 __ lea(index, Operand(object, index, times_1, 0)); |
| 398 SaveFPRegsMode mode = code_->frame()->DidAllocateDoubleRegisters() | 398 SaveFPRegsMode mode = code_->frame()->DidAllocateDoubleRegisters() |
| 399 ? kSaveFPRegs | 399 ? kSaveFPRegs |
| 400 : kDontSaveFPRegs; | 400 : kDontSaveFPRegs; |
| 401 __ RecordWrite(object, index, value, mode); | 401 __ RecordWrite(object, index, value, mode); |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 } | 938 } |
| 939 | 939 |
| 940 | 940 |
| 941 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } | 941 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } |
| 942 | 942 |
| 943 #undef __ | 943 #undef __ |
| 944 | 944 |
| 945 } | 945 } |
| 946 } | 946 } |
| 947 } // namespace v8::internal::compiler | 947 } // namespace v8::internal::compiler |
| OLD | NEW |