decoder.cc (9023:e9201a7bce59) decoder.cc (9024:5851586f399c)
1/*
2 * Copyright (c) 2011 Google
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 394 unchanged lines hidden (view full) ---

403 instDone = true;
404 nextState = ResetState;
405 }
406 else
407 nextState = ImmediateState;
408 return nextState;
409}
410
1/*
2 * Copyright (c) 2011 Google
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 394 unchanged lines hidden (view full) ---

403 instDone = true;
404 nextState = ResetState;
405 }
406 else
407 nextState = ImmediateState;
408 return nextState;
409}
410
411DecodeCache Decoder::defaultCache;
411DecodeCache::InstMap Decoder::instMap;
412DecodeCache::AddrMap<StaticInstPtr> Decoder::decodePages;
412
413
414StaticInstPtr
415Decoder::decode(ExtMachInst mach_inst, Addr addr)
416{
417 StaticInstPtr &si = decodePages.lookup(addr);
418 if (si && (si->machInst == mach_inst))
419 return si;
420
421 DecodeCache::InstMap::iterator iter = instMap.find(mach_inst);
422 if (iter != instMap.end()) {
423 si = iter->second;
424 return si;
425 }
426
427 si = decodeInst(mach_inst);
428 instMap[mach_inst] = si;
429 return si;
413}
430}
431
432}