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

Side by Side Diff: src/mips64/assembler-mips64-inl.h

Issue 1534183002: MIPS64: r6 compact branch optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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
OLDNEW
1 1
2 // Copyright (c) 1994-2006 Sun Microsystems Inc. 2 // Copyright (c) 1994-2006 Sun Microsystems Inc.
3 // All Rights Reserved. 3 // All Rights Reserved.
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // - Redistributions of source code must retain the above copyright notice, 9 // - Redistributions of source code must retain the above copyright notice,
10 // this list of conditions and the following disclaimer. 10 // this list of conditions and the following disclaimer.
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 431 }
432 432
433 433
434 void Assembler::CheckTrampolinePoolQuick(int extra_instructions) { 434 void Assembler::CheckTrampolinePoolQuick(int extra_instructions) {
435 if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) { 435 if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) {
436 CheckTrampolinePool(); 436 CheckTrampolinePool();
437 } 437 }
438 } 438 }
439 439
440 440
441 void Assembler::emit(Instr x) { 441 void Assembler::emit(Instr x, CompactBranchType is_compact_branch) {
442 if (!is_buffer_growth_blocked()) { 442 if (!is_buffer_growth_blocked()) {
443 CheckBuffer(); 443 CheckBuffer();
444 } 444 }
445 if (IsPrevInstrCompactBranch()) {
446 if (Instruction::IsForbiddenAfterBranchInstr(x)) {
447 // Nop instruction to preceed a CTI in forbidden slot:
448 Instr nop = SPECIAL | SLL;
449 *reinterpret_cast<Instr*>(pc_) = nop;
450 pc_ += kInstrSize;
451 }
452 ClearCompactBranchState();
453 }
445 *reinterpret_cast<Instr*>(pc_) = x; 454 *reinterpret_cast<Instr*>(pc_) = x;
446 pc_ += kInstrSize; 455 pc_ += kInstrSize;
456 if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) {
457 EmittedCompactBranchInstruction();
458 }
447 CheckTrampolinePoolQuick(); 459 CheckTrampolinePoolQuick();
448 } 460 }
449 461
450 462
451 void Assembler::emit(uint64_t x) { 463 void Assembler::emit(uint64_t x, CompactBranchType is_compact_branch) {
452 if (!is_buffer_growth_blocked()) { 464 if (!is_buffer_growth_blocked()) {
453 CheckBuffer(); 465 CheckBuffer();
454 } 466 }
467 if (IsPrevInstrCompactBranch()) {
468 // Nop instruction to preceed a CTI in forbidden slot:
Ilija.Pavlovic1 2015/12/18 11:38:22 Missing check IsForbiddenAfterBranchInstr(x)?
balazs.kilvady 2015/12/18 19:18:05 Also when we emitting a 64-bit value that is not a
ivica.bogosavljevic 2015/12/22 10:22:39 There is no need for IsForbiddenAfterBranchInstr(x
balazs.kilvady 2015/12/22 11:01:55 I guess in this case the CPU could not know if the
balazs.kilvady 2016/01/04 13:38:39 I still miss Instruction::IsForbiddenAfterBranchI
469 Instr nop = SPECIAL | SLL;
470 *reinterpret_cast<Instr*>(pc_) = nop;
471 pc_ += kInstrSize;
472
473 ClearCompactBranchState();
474 }
455 *reinterpret_cast<uint64_t*>(pc_) = x; 475 *reinterpret_cast<uint64_t*>(pc_) = x;
456 pc_ += kInstrSize * 2; 476 pc_ += kInstrSize * 2;
Ilija.Pavlovic1 2015/12/18 11:38:22 Missing check is_compact_branch == COMPACT_BRANCH
balazs.kilvady 2015/12/18 19:18:05 A 64-bit value cannot be a real instruction so it
ivica.bogosavljevic 2015/12/22 10:22:39 Acknowledged.
ivica.bogosavljevic 2015/12/22 10:22:39 Done.
457 CheckTrampolinePoolQuick(); 477 CheckTrampolinePoolQuick();
458 } 478 }
459 479
460 480
461 } // namespace internal 481 } // namespace internal
462 } // namespace v8 482 } // namespace v8
463 483
464 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ 484 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698