Skip to content

Commit 8e00090

Browse files
One pass over GlobOpt.cpp, moving and consting
I moved a good number of functions to GlobOptBlockData and BasicBlock. There's also some additions that should make working with const opnds and syms more successful.
1 parent 33533ce commit 8e00090

18 files changed

+3396
-3197
lines changed

lib/Backend/FlowGraph.cpp

Lines changed: 1424 additions & 1 deletion
Large diffs are not rendered by default.

lib/Backend/FlowGraph.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ class BasicBlock
302302

303303
BasicBlock * GetNext()
304304
{
305-
BasicBlock *block = this;
305+
BasicBlock *block = this->next;
306306

307-
do {
307+
while (block && block->isDeleted) {
308308
block = block->next;
309-
} while (block && block->isDeleted);
309+
}
310310

311311
return block;
312312
}
@@ -737,7 +737,7 @@ class Loop
737737
void SetImplicitCallFlags(Js::ImplicitCallFlags flags);
738738
Js::LoopFlags GetLoopFlags() const { return loopFlags; }
739739
void SetLoopFlags(Js::LoopFlags val) { loopFlags = val; }
740-
bool CanHoistInvariants();
740+
bool CanHoistInvariants() const;
741741
bool CanDoFieldCopyProp();
742742
bool CanDoFieldHoist();
743743
void SetHasCall();

lib/Backend/GlobHashTable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class HashBucket
2727
class Key
2828
{
2929
public:
30-
static uint Get(Sym *sym) { return static_cast<uint>(sym->m_id); }
31-
static uint Get(ExprHash hash) { return static_cast<uint>(hash); }
30+
static uint Get(Sym const *sym) { return static_cast<uint>(sym->m_id); }
31+
static uint Get(ExprHash hash) { return static_cast<uint>(hash); }
3232
};
3333

3434
#define FOREACH_GLOBHASHTABLE_ENTRY(bucket, hashTable) \

0 commit comments

Comments
 (0)