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

Side by Side Diff: src/mips/assembler-mips.cc

Issue 7062014: MIPS: Added the stop() instruction with same behavior as on Arm simulator. (Closed)
Patch Set: Created 9 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
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 1329
1330 1330
1331 void Assembler::lui(Register rd, int32_t j) { 1331 void Assembler::lui(Register rd, int32_t j) {
1332 GenInstrImmediate(LUI, zero_reg, rd, j); 1332 GenInstrImmediate(LUI, zero_reg, rd, j);
1333 } 1333 }
1334 1334
1335 1335
1336 //-------------Misc-instructions-------------- 1336 //-------------Misc-instructions--------------
1337 1337
1338 // Break / Trap instructions. 1338 // Break / Trap instructions.
1339 void Assembler::break_(uint32_t code) { 1339 void Assembler::break_(uint32_t code, bool break_as_stop) {
1340 ASSERT((code & ~0xfffff) == 0); 1340 ASSERT((code & ~0xfffff) == 0);
1341 // We need to invalidate breaks that could be stops as well because the
1342 // simulator expects a char pointer after the stop instruction.
1343 // See constants-mips.h for explanation.
1344 ASSERT((break_as_stop &&
1345 code <= kMaxStopCode &&
1346 code > kMaxWatchpointCode) ||
1347 (!break_as_stop &&
1348 (code > kMaxStopCode ||
1349 code <= kMaxWatchpointCode)));
1341 Instr break_instr = SPECIAL | BREAK | (code << 6); 1350 Instr break_instr = SPECIAL | BREAK | (code << 6);
1342 emit(break_instr); 1351 emit(break_instr);
1343 } 1352 }
1344 1353
1345 1354
1355 void Assembler::stop(const char* msg, uint32_t code) {
1356 ASSERT(code > kMaxWatchpointCode);
1357 ASSERT(code <= kMaxStopCode);
1358 #if defined(V8_HOST_ARCH_MIPS)
1359 break_(0x54321);
1360 #else // V8_HOST_ARCH_MIPS
1361 BlockTrampolinePoolFor(2);
1362 // The Simulator will handle the stop instruction and get the message address.
1363 // On MIPS stop() is just a special kind of break_().
1364 break_(code, true);
1365 emit(reinterpret_cast<Instr>(msg));
1366 #endif
1367 }
1368
1369
1346 void Assembler::tge(Register rs, Register rt, uint16_t code) { 1370 void Assembler::tge(Register rs, Register rt, uint16_t code) {
1347 ASSERT(is_uint10(code)); 1371 ASSERT(is_uint10(code));
1348 Instr instr = SPECIAL | TGE | rs.code() << kRsShift 1372 Instr instr = SPECIAL | TGE | rs.code() << kRsShift
1349 | rt.code() << kRtShift | code << 6; 1373 | rt.code() << kRtShift | code << 6;
1350 emit(instr); 1374 emit(instr);
1351 } 1375 }
1352 1376
1353 1377
1354 void Assembler::tgeu(Register rs, Register rt, uint16_t code) { 1378 void Assembler::tgeu(Register rs, Register rt, uint16_t code) {
1355 ASSERT(is_uint10(code)); 1379 ASSERT(is_uint10(code));
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 *p = LUI | rt_code | ((itarget & kHiMask) >> kLuiShift); 1975 *p = LUI | rt_code | ((itarget & kHiMask) >> kLuiShift);
1952 *(p+1) = ORI | rt_code | (rt_code << 5) | (itarget & kImm16Mask); 1976 *(p+1) = ORI | rt_code | (rt_code << 5) | (itarget & kImm16Mask);
1953 1977
1954 CPU::FlushICache(pc, 2 * sizeof(int32_t)); 1978 CPU::FlushICache(pc, 2 * sizeof(int32_t));
1955 } 1979 }
1956 1980
1957 1981
1958 } } // namespace v8::internal 1982 } } // namespace v8::internal
1959 1983
1960 #endif // V8_TARGET_ARCH_MIPS 1984 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips/constants-mips.h » ('j') | src/mips/simulator-mips.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698