Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index ceac829cf80351d1a8d483b020047cd10a0df706..5779aae81bcb92e1b8bff82f68b177bb76bcd871 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -55,7 +55,7 @@ CompilationInfo::CompilationInfo(Handle<Script> script, Zone* zone) |
: flags_(LanguageModeField::encode(CLASSIC_MODE)), |
script_(script), |
osr_ast_id_(BailoutId::None()) { |
- Initialize(script->GetIsolate(), BASE, zone); |
+ Initialize(zone); |
} |
@@ -65,7 +65,7 @@ CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info, |
shared_info_(shared_info), |
script_(Handle<Script>(Script::cast(shared_info->script()))), |
osr_ast_id_(BailoutId::None()) { |
- Initialize(script_->GetIsolate(), BASE, zone); |
+ Initialize(zone); |
} |
@@ -76,22 +76,12 @@ CompilationInfo::CompilationInfo(Handle<JSFunction> closure, Zone* zone) |
script_(Handle<Script>(Script::cast(shared_info_->script()))), |
context_(closure->context()), |
osr_ast_id_(BailoutId::None()) { |
- Initialize(script_->GetIsolate(), BASE, zone); |
+ Initialize(zone); |
} |
-CompilationInfo::CompilationInfo(HydrogenCodeStub* stub, |
- Isolate* isolate, Zone* zone) |
- : flags_(LanguageModeField::encode(CLASSIC_MODE) | |
- IsLazy::encode(true)), |
- osr_ast_id_(BailoutId::None()) { |
- Initialize(isolate, STUB, zone); |
- code_stub_ = stub; |
-} |
- |
- |
-void CompilationInfo::Initialize(Isolate* isolate, Mode mode, Zone* zone) { |
- isolate_ = isolate; |
+void CompilationInfo::Initialize(Zone* zone) { |
+ isolate_ = script_->GetIsolate(); |
function_ = NULL; |
scope_ = NULL; |
global_scope_ = NULL; |
@@ -99,13 +89,8 @@ void CompilationInfo::Initialize(Isolate* isolate, Mode mode, Zone* zone) { |
pre_parse_data_ = NULL; |
zone_ = zone; |
deferred_handles_ = NULL; |
- code_stub_ = NULL; |
prologue_offset_ = kPrologueOffsetNotSet; |
- if (mode == STUB) { |
- mode_ = STUB; |
- return; |
- } |
- mode_ = V8::UseCrankshaft() ? mode : NONOPT; |
+ mode_ = V8::UseCrankshaft() ? BASE : NONOPT; |
if (script_->type()->value() == Script::TYPE_NATIVE) { |
MarkAsNative(); |
} |
@@ -122,33 +107,6 @@ CompilationInfo::~CompilationInfo() { |
} |
-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 = |
@@ -359,13 +317,13 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() { |
if (FLAG_trace_hydrogen) { |
PrintF("-----------------------------------------------------------\n"); |
PrintF("Compiling method %s using hydrogen\n", *name->ToCString()); |
- HTracer::Instance()->TraceCompilation(info()); |
+ HTracer::Instance()->TraceCompilation(info()->function()); |
} |
Handle<Context> native_context( |
info()->closure()->context()->native_context()); |
oracle_ = new(info()->zone()) TypeFeedbackOracle( |
code, native_context, info()->isolate(), info()->zone()); |
- graph_builder_ = new(info()->zone()) HOptimizedGraphBuilder(info(), oracle_); |
+ graph_builder_ = new(info()->zone()) HGraphBuilder(info(), oracle_); |
Timer t(this, &time_taken_to_create_graph_); |
graph_ = graph_builder_->CreateGraph(); |
@@ -418,7 +376,7 @@ OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() { |
Timer timer(this, &time_taken_to_codegen_); |
ASSERT(chunk_ != NULL); |
ASSERT(graph_ != NULL); |
- Handle<Code> optimized_code = chunk_->Codegen(Code::OPTIMIZED_FUNCTION); |
+ Handle<Code> optimized_code = chunk_->Codegen(); |
if (optimized_code.is_null()) { |
info()->set_bailout_reason("code generation failed"); |
return AbortOptimization(); |