summaryrefslogtreecommitdiff
path: root/src/compiler/Frontend.cc
diff options
context:
space:
mode:
author Elliott Hughes <enh@google.com> 2012-04-14 11:46:01 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-04-14 11:46:01 -0700
commit42f302c1da4cf1abf935d7aee29ece8d90441e0c (patch)
tree1313bbbf93b2983e4046c5eaf023c48377e7fb9a /src/compiler/Frontend.cc
parent33687790adbb889abdd95bb22914acb57ce6e68c (diff)
parenta0e180632411f7fe0edf454e571c42209ee7b540 (diff)
Merge "Add a SafeMap equivalent to std::map but without the error-prone operator[]." into ics-mr1-plus-art
Diffstat (limited to 'src/compiler/Frontend.cc')
-rw-r--r--src/compiler/Frontend.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/Frontend.cc b/src/compiler/Frontend.cc
index 309bcf82d8..dbaf323a2d 100644
--- a/src/compiler/Frontend.cc
+++ b/src/compiler/Frontend.cc
@@ -136,8 +136,7 @@ BasicBlock *splitBlock(CompilationUnit* cUnit, unsigned int codeOffset,
bottomBlock->lastMIRInsn = origBlock->lastMIRInsn;
/* Add it to the quick lookup cache */
- cUnit->blockMap.insert(std::make_pair(bottomBlock->startOffset,
- bottomBlock));
+ cUnit->blockMap.Put(bottomBlock->startOffset, bottomBlock);
/* Handle the taken path */
bottomBlock->taken = origBlock->taken;
@@ -211,7 +210,7 @@ BasicBlock *findBlock(CompilationUnit* cUnit, unsigned int codeOffset,
GrowableList* blockList = &cUnit->blockList;
BasicBlock* bb;
unsigned int i;
- std::map<unsigned int, BasicBlock*>::iterator it;
+ SafeMap<unsigned int, BasicBlock*>::iterator it;
it = cUnit->blockMap.find(codeOffset);
if (it != cUnit->blockMap.end()) {
@@ -239,7 +238,7 @@ BasicBlock *findBlock(CompilationUnit* cUnit, unsigned int codeOffset,
bb = oatNewBB(cUnit, kDalvikByteCode, cUnit->numBlocks++);
oatInsertGrowableList(cUnit, &cUnit->blockList, (intptr_t) bb);
bb->startOffset = codeOffset;
- cUnit->blockMap.insert(std::make_pair(bb->startOffset, bb));
+ cUnit->blockMap.Put(bb->startOffset, bb);
return bb;
}
@@ -853,7 +852,7 @@ CompiledMethod* oatCompileMethod(Compiler& compiler,
curBlock->startOffset = 0;
oatInsertGrowableList(cUnit.get(), &cUnit->blockList, (intptr_t) curBlock);
/* Add first block to the fast lookup cache */
- cUnit->blockMap.insert(std::make_pair(curBlock->startOffset, curBlock));
+ cUnit->blockMap.Put(curBlock->startOffset, curBlock);
entryBlock->fallThrough = curBlock;
oatInsertGrowableList(cUnit.get(), curBlock->predecessors,
(intptr_t)entryBlock);