decoder.hh (12334:e0ab29a34764) decoder.hh (12621:982f22db6230)
1/*
2 * Copyright (c) 2012 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;

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

224
225 typedef MiscReg CacheKey;
226
227 typedef DecodeCache::AddrMap<Decoder::InstBytes> DecodePages;
228 DecodePages *decodePages;
229 typedef std::unordered_map<CacheKey, DecodePages *> AddrCacheMap;
230 AddrCacheMap addrCacheMap;
231
1/*
2 * Copyright (c) 2012 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;

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

224
225 typedef MiscReg CacheKey;
226
227 typedef DecodeCache::AddrMap<Decoder::InstBytes> DecodePages;
228 DecodePages *decodePages;
229 typedef std::unordered_map<CacheKey, DecodePages *> AddrCacheMap;
230 AddrCacheMap addrCacheMap;
231
232 DecodeCache::InstMap *instMap;
233 typedef std::unordered_map<CacheKey, DecodeCache::InstMap *> InstCacheMap;
232 DecodeCache::InstMap<ExtMachInst> *instMap;
233 typedef std::unordered_map<
234 CacheKey, DecodeCache::InstMap<ExtMachInst> *> InstCacheMap;
234 static InstCacheMap instCacheMap;
235
236 public:
237 Decoder(ISA* isa = nullptr) : basePC(0), origPC(0), offset(0),
238 outOfBytes(true), instDone(false),
239 state(ResetState)
240 {
241 memset(&emi, 0, sizeof(emi));

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

272 decodePages = new DecodePages;
273 addrCacheMap[m5Reg] = decodePages;
274 }
275
276 InstCacheMap::iterator imIter = instCacheMap.find(m5Reg);
277 if (imIter != instCacheMap.end()) {
278 instMap = imIter->second;
279 } else {
235 static InstCacheMap instCacheMap;
236
237 public:
238 Decoder(ISA* isa = nullptr) : basePC(0), origPC(0), offset(0),
239 outOfBytes(true), instDone(false),
240 state(ResetState)
241 {
242 memset(&emi, 0, sizeof(emi));

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

273 decodePages = new DecodePages;
274 addrCacheMap[m5Reg] = decodePages;
275 }
276
277 InstCacheMap::iterator imIter = instCacheMap.find(m5Reg);
278 if (imIter != instCacheMap.end()) {
279 instMap = imIter->second;
280 } else {
280 instMap = new DecodeCache::InstMap;
281 instMap = new DecodeCache::InstMap<ExtMachInst>;
281 instCacheMap[m5Reg] = instMap;
282 }
283 }
284
285 void takeOverFrom(Decoder *old)
286 {
287 mode = old->mode;
288 submode = old->submode;

--- 65 unchanged lines hidden ---
282 instCacheMap[m5Reg] = instMap;
283 }
284 }
285
286 void takeOverFrom(Decoder *old)
287 {
288 mode = old->mode;
289 submode = old->submode;

--- 65 unchanged lines hidden ---