summaryrefslogtreecommitdiffstats
path: root/V8Binding/v8/src/compiler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'V8Binding/v8/src/compiler.cc')
-rw-r--r--V8Binding/v8/src/compiler.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/V8Binding/v8/src/compiler.cc b/V8Binding/v8/src/compiler.cc
index aecdfb9..f0d97fe 100644
--- a/V8Binding/v8/src/compiler.cc
+++ b/V8Binding/v8/src/compiler.cc
@@ -28,6 +28,7 @@
#include "v8.h"
#include "bootstrapper.h"
+#include "cfg.h"
#include "codegen-inl.h"
#include "compilation-cache.h"
#include "compiler.h"
@@ -78,6 +79,22 @@ static Handle<Code> MakeCode(FunctionLiteral* literal,
return Handle<Code>::null();
}
+ if (FLAG_multipass) {
+ CfgGlobals scope(literal);
+ Cfg* cfg = Cfg::Build();
+#ifdef DEBUG
+ if (FLAG_print_cfg && cfg != NULL) {
+ SmartPointer<char> name = literal->name()->ToCString();
+ PrintF("Function \"%s\":\n", *name);
+ cfg->Print();
+ PrintF("\n");
+ }
+#endif
+ if (cfg != NULL) {
+ return cfg->Compile(script);
+ }
+ }
+
// Generate code and return it.
Handle<Code> result = CodeGenerator::MakeCode(literal, script, is_eval);
return result;