Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: src/compiler/s390/code-generator-s390.cc

Issue 1921073003: S390X: [turbofan] Fix checked loads/stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use macroassembler Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/s390/macro-assembler-s390.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 AddressingMode mode = kMode_None; \ 459 AddressingMode mode = kMode_None; \
460 MemOperand operand = i.MemoryOperand(&mode, index); \ 460 MemOperand operand = i.MemoryOperand(&mode, index); \
461 Register offset = operand.rb(); \ 461 Register offset = operand.rb(); \
462 if (HasRegisterInput(instr, 2)) { \ 462 if (HasRegisterInput(instr, 2)) { \
463 __ CmpLogical32(offset, i.InputRegister(2)); \ 463 __ CmpLogical32(offset, i.InputRegister(2)); \
464 } else { \ 464 } else { \
465 __ CmpLogical32(offset, i.InputImmediate(2)); \ 465 __ CmpLogical32(offset, i.InputImmediate(2)); \
466 } \ 466 } \
467 auto ool = new (zone()) OutOfLineLoadNAN##width(this, result); \ 467 auto ool = new (zone()) OutOfLineLoadNAN##width(this, result); \
468 __ bge(ool->entry()); \ 468 __ bge(ool->entry()); \
469 __ CleanUInt32(offset); \
469 __ asm_instr(result, operand); \ 470 __ asm_instr(result, operand); \
470 __ bind(ool->exit()); \ 471 __ bind(ool->exit()); \
471 } while (0) 472 } while (0)
472 473
473 #define ASSEMBLE_CHECKED_LOAD_INTEGER(asm_instr) \ 474 #define ASSEMBLE_CHECKED_LOAD_INTEGER(asm_instr) \
474 do { \ 475 do { \
475 Register result = i.OutputRegister(); \ 476 Register result = i.OutputRegister(); \
476 size_t index = 0; \ 477 size_t index = 0; \
477 AddressingMode mode = kMode_None; \ 478 AddressingMode mode = kMode_None; \
478 MemOperand operand = i.MemoryOperand(&mode, index); \ 479 MemOperand operand = i.MemoryOperand(&mode, index); \
479 Register offset = operand.rb(); \ 480 Register offset = operand.rb(); \
480 if (HasRegisterInput(instr, 2)) { \ 481 if (HasRegisterInput(instr, 2)) { \
481 __ CmpLogical32(offset, i.InputRegister(2)); \ 482 __ CmpLogical32(offset, i.InputRegister(2)); \
482 } else { \ 483 } else { \
483 __ CmpLogical32(offset, i.InputImmediate(2)); \ 484 __ CmpLogical32(offset, i.InputImmediate(2)); \
484 } \ 485 } \
485 auto ool = new (zone()) OutOfLineLoadZero(this, result); \ 486 auto ool = new (zone()) OutOfLineLoadZero(this, result); \
486 __ bge(ool->entry()); \ 487 __ bge(ool->entry()); \
488 __ CleanUInt32(offset); \
487 __ asm_instr(result, operand); \ 489 __ asm_instr(result, operand); \
488 __ bind(ool->exit()); \ 490 __ bind(ool->exit()); \
489 } while (0) 491 } while (0)
490 492
491 #define ASSEMBLE_CHECKED_STORE_FLOAT32() \ 493 #define ASSEMBLE_CHECKED_STORE_FLOAT32() \
492 do { \ 494 do { \
493 Label done; \ 495 Label done; \
494 size_t index = 0; \ 496 size_t index = 0; \
495 AddressingMode mode = kMode_None; \ 497 AddressingMode mode = kMode_None; \
496 MemOperand operand = i.MemoryOperand(&mode, index); \ 498 MemOperand operand = i.MemoryOperand(&mode, index); \
497 Register offset = operand.rb(); \ 499 Register offset = operand.rb(); \
498 if (HasRegisterInput(instr, 2)) { \ 500 if (HasRegisterInput(instr, 2)) { \
499 __ CmpLogical32(offset, i.InputRegister(2)); \ 501 __ CmpLogical32(offset, i.InputRegister(2)); \
500 } else { \ 502 } else { \
501 __ CmpLogical32(offset, i.InputImmediate(2)); \ 503 __ CmpLogical32(offset, i.InputImmediate(2)); \
502 } \ 504 } \
503 __ bge(&done); \ 505 __ bge(&done); \
504 DoubleRegister value = i.InputDoubleRegister(3); \ 506 DoubleRegister value = i.InputDoubleRegister(3); \
507 __ CleanUInt32(offset); \
505 __ StoreFloat32(value, operand); \ 508 __ StoreFloat32(value, operand); \
506 __ bind(&done); \ 509 __ bind(&done); \
507 } while (0) 510 } while (0)
508 511
509 #define ASSEMBLE_CHECKED_STORE_DOUBLE() \ 512 #define ASSEMBLE_CHECKED_STORE_DOUBLE() \
510 do { \ 513 do { \
511 Label done; \ 514 Label done; \
512 size_t index = 0; \ 515 size_t index = 0; \
513 AddressingMode mode = kMode_None; \ 516 AddressingMode mode = kMode_None; \
514 MemOperand operand = i.MemoryOperand(&mode, index); \ 517 MemOperand operand = i.MemoryOperand(&mode, index); \
515 DCHECK_EQ(kMode_MRR, mode); \ 518 DCHECK_EQ(kMode_MRR, mode); \
516 Register offset = operand.rb(); \ 519 Register offset = operand.rb(); \
517 if (HasRegisterInput(instr, 2)) { \ 520 if (HasRegisterInput(instr, 2)) { \
518 __ CmpLogical32(offset, i.InputRegister(2)); \ 521 __ CmpLogical32(offset, i.InputRegister(2)); \
519 } else { \ 522 } else { \
520 __ CmpLogical32(offset, i.InputImmediate(2)); \ 523 __ CmpLogical32(offset, i.InputImmediate(2)); \
521 } \ 524 } \
522 __ bge(&done); \ 525 __ bge(&done); \
523 DoubleRegister value = i.InputDoubleRegister(3); \ 526 DoubleRegister value = i.InputDoubleRegister(3); \
527 __ CleanUInt32(offset); \
524 __ StoreDouble(value, operand); \ 528 __ StoreDouble(value, operand); \
525 __ bind(&done); \ 529 __ bind(&done); \
526 } while (0) 530 } while (0)
527 531
528 #define ASSEMBLE_CHECKED_STORE_INTEGER(asm_instr) \ 532 #define ASSEMBLE_CHECKED_STORE_INTEGER(asm_instr) \
529 do { \ 533 do { \
530 Label done; \ 534 Label done; \
531 size_t index = 0; \ 535 size_t index = 0; \
532 AddressingMode mode = kMode_None; \ 536 AddressingMode mode = kMode_None; \
533 MemOperand operand = i.MemoryOperand(&mode, index); \ 537 MemOperand operand = i.MemoryOperand(&mode, index); \
534 Register offset = operand.rb(); \ 538 Register offset = operand.rb(); \
535 if (HasRegisterInput(instr, 2)) { \ 539 if (HasRegisterInput(instr, 2)) { \
536 __ CmpLogical32(offset, i.InputRegister(2)); \ 540 __ CmpLogical32(offset, i.InputRegister(2)); \
537 } else { \ 541 } else { \
538 __ CmpLogical32(offset, i.InputImmediate(2)); \ 542 __ CmpLogical32(offset, i.InputImmediate(2)); \
539 } \ 543 } \
540 __ bge(&done); \ 544 __ bge(&done); \
541 Register value = i.InputRegister(3); \ 545 Register value = i.InputRegister(3); \
546 __ CleanUInt32(offset); \
542 __ asm_instr(value, operand); \ 547 __ asm_instr(value, operand); \
543 __ bind(&done); \ 548 __ bind(&done); \
544 } while (0) 549 } while (0)
545 550
546 void CodeGenerator::AssembleDeconstructFrame() { 551 void CodeGenerator::AssembleDeconstructFrame() {
547 __ LeaveFrame(StackFrame::MANUAL); 552 __ LeaveFrame(StackFrame::MANUAL);
548 } 553 }
549 554
550 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { 555 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) {
551 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); 556 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta);
(...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after
2118 padding_size -= 2; 2123 padding_size -= 2;
2119 } 2124 }
2120 } 2125 }
2121 } 2126 }
2122 2127
2123 #undef __ 2128 #undef __
2124 2129
2125 } // namespace compiler 2130 } // namespace compiler
2126 } // namespace internal 2131 } // namespace internal
2127 } // namespace v8 2132 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/s390/macro-assembler-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698