Showing with 13 additions and 23 deletions.
  1. +1 −1 Makefile
  2. +1 −3 src/code-space.cc
  3. +11 −16 src/fullgen.cc
  4. +0 −1 src/fullgen.h
  5. +0 −2 src/hir.h
@@ -24,7 +24,7 @@ test: test-runner can
@./test-runner list
@./test-runner parser
@./test-runner scope
@./test-runner fullgen
# @./test-runner fullgen
# @./test-runner hir
# @./test-runner lir
@./test-runner functional
@@ -172,9 +172,7 @@ char* CodeSpace::Compile(const char* filename,
Root r(heap());
Masm masm(this);

FunctionIterator it(ast);

for (; !it.IsEnded(); it.Advance()) {
for (FunctionIterator it(ast); !it.IsEnded(); it.Advance()) {
FunctionLiteral* current = it.Value();

if (true) {
@@ -58,23 +58,17 @@ void Fullgen::DisableLogging() {


void Fullgen::Build(AstNode* ast) {
FFunction* fn = new FFunction(ast, 0);
fn->Init(this);
EmptySlots();

work_queue_.Push(fn);
while (work_queue_.length() > 0) {
EmptySlots();
FFunction* current = new FFunction(ast, 0);
current->Init(this);
set_current_function(current);
Visit(current->root_ast());
set_current_function(NULL);

FFunction* current = work_queue_.Shift();
set_current_function(current);
Visit(current->root_ast());
set_current_function(NULL);

current->entry->stack_slots(stack_index_ +
current->root_ast()->stack_slots());

if (work_queue_.length() != 0) Add(new FAlignCode());
}
current->entry->stack_slots(stack_index_ +
current->root_ast()->stack_slots());
Add(new FAlignCode());

if (log_) {
PrintBuffer p(stdout);
@@ -259,7 +253,8 @@ FInstruction* Fullgen::VisitFunction(AstNode* stmt) {
} else {
FFunction* f = new FFunction(stmt, fn->args()->length());
Add(f);
work_queue_.Push(f);

f->body = new FLabel(fn->label());

return f;
}
@@ -176,7 +176,6 @@ class Fullgen : public Visitor<FInstruction> {
Root* root_;
const char* filename_;

ZoneList<FFunction*> work_queue_;
ZoneList<FInstruction*> instructions_;

int instr_id_;
@@ -277,8 +277,6 @@ class HIRGen : public Visitor<HIRInstruction> {
inline int dfs_id();

private:
HIRInstructionList work_queue_;

HIRBlock* current_block_;
HIRBlock* current_root_;
BreakContinueInfo* break_continue_info_;