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

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

Issue 1396133002: MIPS: r6 compact branch optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « src/mips/assembler-mips.cc ('k') | src/mips/constants-mips.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 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 } 438 }
439 439
440 440
441 void Assembler::CheckTrampolinePoolQuick(int extra_instructions) { 441 void Assembler::CheckTrampolinePoolQuick(int extra_instructions) {
442 if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) { 442 if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) {
443 CheckTrampolinePool(); 443 CheckTrampolinePool();
444 } 444 }
445 } 445 }
446 446
447 447
448 void Assembler::emit(Instr x) { 448 void Assembler::emit(Instr x, CompactBranchType is_compact_branch) {
449 if (!is_buffer_growth_blocked()) { 449 if (!is_buffer_growth_blocked()) {
450 CheckBuffer(); 450 CheckBuffer();
451 } 451 }
452 if (IsPrevInstrCompactBranch()) {
453 if (Instruction::IsForbiddenAfterBranchInstr(x)) {
454 // Nop instruction to preceed a CTI in forbidden slot:
455 Instr nop = SPECIAL | SLL;
456 *reinterpret_cast<Instr*>(pc_) = nop;
457 pc_ += kInstrSize;
458 }
459 ClearCompactBranchState();
460 }
452 *reinterpret_cast<Instr*>(pc_) = x; 461 *reinterpret_cast<Instr*>(pc_) = x;
453 pc_ += kInstrSize; 462 pc_ += kInstrSize;
463 if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) {
464 EmittedCompactBranchInstruction();
465 }
454 CheckTrampolinePoolQuick(); 466 CheckTrampolinePoolQuick();
455 } 467 }
456 468
457 469
458 } // namespace internal 470 } // namespace internal
459 } // namespace v8 471 } // namespace v8
460 472
461 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ 473 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.cc ('k') | src/mips/constants-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698