diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-03-10 10:50:46 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-03-10 10:50:46 -0800 |
commit | 073947c150316cfc0bd440851e590663c3b67814 (patch) | |
tree | 892fc64c0d5cdfd021c14af01a631f6b6c91b982 /deps/v8/src/compiler.cc | |
parent | c2c0cfb75f46ddcb3a0900f244966764d2640240 (diff) | |
download | node-073947c150316cfc0bd440851e590663c3b67814.tar.gz |
Upgrade V8 to 2.1.3
Diffstat (limited to 'deps/v8/src/compiler.cc')
-rwxr-xr-x | deps/v8/src/compiler.cc | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/deps/v8/src/compiler.cc b/deps/v8/src/compiler.cc index 557a91e4d..ebb62f11c 100755 --- a/deps/v8/src/compiler.cc +++ b/deps/v8/src/compiler.cc @@ -31,14 +31,14 @@ #include "codegen-inl.h" #include "compilation-cache.h" #include "compiler.h" +#include "data-flow.h" #include "debug.h" #include "fast-codegen.h" #include "full-codegen.h" +#include "liveedit.h" #include "oprofile-agent.h" #include "rewriter.h" #include "scopes.h" -#include "usage-analyzer.h" -#include "liveedit.h" namespace v8 { namespace internal { @@ -48,7 +48,7 @@ static Handle<Code> MakeCode(Handle<Context> context, CompilationInfo* info) { FunctionLiteral* function = info->function(); ASSERT(function != NULL); // Rewrite the AST by introducing .result assignments where needed. - if (!Rewriter::Process(function) || !AnalyzeVariableUsage(function)) { + if (!Rewriter::Process(function)) { // Signal a stack overflow by returning a null handle. The stack // overflow exception will be thrown by the caller. return Handle<Code>::null(); @@ -79,6 +79,17 @@ static Handle<Code> MakeCode(Handle<Context> context, CompilationInfo* info) { return Handle<Code>::null(); } + if (FLAG_use_flow_graph) { + FlowGraphBuilder builder; + builder.Build(function); + +#ifdef DEBUG + if (FLAG_print_graph_text) { + builder.graph()->PrintText(builder.postorder()); + } +#endif + } + // Generate code and return it. Code generator selection is governed by // which backends are enabled and whether the function is considered // run-once code or not: @@ -117,6 +128,14 @@ static Handle<Code> MakeCode(Handle<Context> context, CompilationInfo* info) { } +#ifdef ENABLE_DEBUGGER_SUPPORT +Handle<Code> MakeCodeForLiveEdit(CompilationInfo* info) { + Handle<Context> context = Handle<Context>::null(); + return MakeCode(context, info); +} +#endif + + static Handle<JSFunction> MakeFunction(bool is_global, bool is_eval, Compiler::ValidationState validate, @@ -224,7 +243,7 @@ static Handle<JSFunction> MakeFunction(bool is_global, #ifdef ENABLE_DEBUGGER_SUPPORT // Notify debugger - Debugger::OnAfterCompile(script, fun); + Debugger::OnAfterCompile(script, Debugger::NO_AFTER_COMPILE_FLAGS); #endif return fun; @@ -444,6 +463,17 @@ Handle<JSFunction> Compiler::BuildBoilerplate(FunctionLiteral* literal, return Handle<JSFunction>::null(); } + if (FLAG_use_flow_graph) { + FlowGraphBuilder builder; + builder.Build(literal); + +#ifdef DEBUG + if (FLAG_print_graph_text) { + builder.graph()->PrintText(builder.postorder()); + } +#endif + } + // Generate code and return it. The way that the compilation mode // is controlled by the command-line flags is described in // the static helper function MakeCode. |