| Index: src/compiler.cc
|
| diff --git a/src/compiler.cc b/src/compiler.cc
|
| index 4250de18c9459dd5bb8ba387c7204b81f1618473..bc474e5b437e876dec512b364c17f3461a600f80 100644
|
| --- a/src/compiler.cc
|
| +++ b/src/compiler.cc
|
| @@ -106,11 +106,54 @@ CompilationInfo::CompilationInfo(Handle<JSFunction> closure, Zone* zone)
|
| }
|
|
|
|
|
| +CompilationInfo::CompilationInfo(Isolate* isolate, Zone* zone)
|
| + : isolate_(isolate),
|
| + flags_(LanguageModeField::encode(CLASSIC_MODE) |
|
| + IsLazy::encode(true)),
|
| + function_(NULL),
|
| + scope_(NULL),
|
| + global_scope_(NULL),
|
| + extension_(NULL),
|
| + pre_parse_data_(NULL),
|
| + osr_ast_id_(BailoutId::None()),
|
| + zone_(zone),
|
| + deferred_handles_(NULL) {
|
| + Initialize(STUB);
|
| +}
|
| +
|
| +
|
| CompilationInfo::~CompilationInfo() {
|
| delete deferred_handles_;
|
| }
|
|
|
|
|
| +int CompilationInfo::num_parameters() const {
|
| + if (IsStub()) {
|
| + return 0;
|
| + } else {
|
| + return scope()->num_parameters();
|
| + }
|
| +}
|
| +
|
| +
|
| +int CompilationInfo::num_heap_slots() const {
|
| + if (IsStub()) {
|
| + return 0;
|
| + } else {
|
| + return scope()->num_heap_slots();
|
| + }
|
| +}
|
| +
|
| +
|
| +Code::Flags CompilationInfo::flags() const {
|
| + if (IsStub()) {
|
| + return Code::ComputeFlags(Code::COMPILED_STUB);
|
| + } else {
|
| + return Code::ComputeFlags(Code::OPTIMIZED_FUNCTION);
|
| + }
|
| +}
|
| +
|
| +
|
| // Disable optimization for the rest of the compilation pipeline.
|
| void CompilationInfo::DisableOptimization() {
|
| bool is_optimizable_closure =
|
| @@ -317,7 +360,7 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
|
| if (FLAG_trace_hydrogen) {
|
| PrintF("-----------------------------------------------------------\n");
|
| PrintF("Compiling method %s using hydrogen\n", *name->ToCString());
|
| - HTracer::Instance()->TraceCompilation(info()->function());
|
| + HTracer::Instance()->TraceCompilation(info());
|
| }
|
| Handle<Context> native_context(
|
| info()->closure()->context()->native_context());
|
| @@ -374,7 +417,7 @@ OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() {
|
| Timer timer(this, &time_taken_to_codegen_);
|
| ASSERT(chunk_ != NULL);
|
| ASSERT(graph_ != NULL);
|
| - Handle<Code> optimized_code = chunk_->Codegen();
|
| + Handle<Code> optimized_code = chunk_->Codegen(Code::OPTIMIZED_FUNCTION);
|
| if (optimized_code.is_null()) {
|
| info()->set_bailout_reason("code generation failed");
|
| return AbortOptimization();
|
|
|