- function =
- v8::Utils::OpenHandle(*v8::Handle<v8::Function>::Cast(CompileRun(
- "(function() { 'use strict'; return 2.7123; })")));
- CompilationInfoWithZone info(function);
- CHECK(Parser::Parse(&info));
- info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code()));
- CHECK(Rewriter::Rewrite(&info));
- CHECK(Scope::Analyze(&info));
- CHECK_NE(NULL, info.scope());
- Handle<ScopeInfo> scope_info =
- ScopeInfo::Create(info.scope(), info.zone());
- info.shared_info()->set_scope_info(*scope_info);
- Pipeline pipeline(&info);
- Linkage linkage(&info);
- Handle<Code> code =
- pipeline.GenerateCodeForMachineGraph(&linkage, this->graph());
- CHECK(!code.is_null());
- function->ReplaceCode(*code);