Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index 05a8618fce3d65fb30d8d561f46466b02477acc8..44aaecb7e4715c7a0fdef8ac6d850fe28b069d4c 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -3450,10 +3450,7 @@ HGraph::HGraph(CompilationInfo* info) |
| type_change_checksum_(0), |
| maximum_environment_size_(0), |
| no_side_effects_scope_count_(0), |
| - disallow_adding_new_values_(false), |
| - inlined_functions_(FLAG_hydrogen_track_positions ? 5 : 0, info->zone()), |
| - inlining_id_to_function_id_(FLAG_hydrogen_track_positions ? 5 : 0, |
| - info->zone()) { |
| + disallow_adding_new_values_(false) { |
| if (info->IsStub()) { |
| CallInterfaceDescriptor descriptor = |
| info->code_stub()->GetCallInterfaceDescriptor(); |
| @@ -3495,41 +3492,10 @@ int HGraph::TraceInlinedFunction( |
| return 0; |
| } |
| - int id = 0; |
| - for (; id < inlined_functions_.length(); id++) { |
| - if (inlined_functions_[id].shared().is_identical_to(shared)) { |
| - break; |
| - } |
| - } |
| - |
| - if (id == inlined_functions_.length()) { |
| - inlined_functions_.Add(InlinedFunctionInfo(shared), zone()); |
| - |
| - if (!shared->script()->IsUndefined()) { |
| - Handle<Script> script(Script::cast(shared->script())); |
| - if (!script->source()->IsUndefined()) { |
| - CodeTracer::Scope tracing_scopex(isolate()->GetCodeTracer()); |
| - OFStream os(tracing_scopex.file()); |
| - os << "--- FUNCTION SOURCE (" << shared->DebugName()->ToCString().get() |
| - << ") id{" << info()->optimization_id() << "," << id << "} ---\n"; |
| - { |
| - DisallowHeapAllocation no_allocation; |
| - int start = shared->start_position(); |
| - int len = shared->end_position() - start + 1; |
| - String::SubStringRange source(String::cast(script->source()), start, |
| - len); |
| - for (const auto& c : source) { |
| - os << AsReversiblyEscapedUC16(c); |
| - } |
| - } |
| - |
| - os << "\n--- END ---\n"; |
| - } |
| - } |
| - } |
| + int id = info()->GetInlinedFunctionId(shared); |
| - int inline_id = inlining_id_to_function_id_.length(); |
| - inlining_id_to_function_id_.Add(id, zone()); |
| + int inline_id = info()->inlining_id_to_function_id()->length(); |
|
Vyacheslav Egorov (Google)
2015/02/16 13:38:50
Should not all this code be also moved into GetInl
loislo
2015/02/16 14:48:32
Done.
|
| + info()->inlining_id_to_function_id()->Add(id); |
| if (inline_id != 0) { |
| CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer()); |
| @@ -3548,8 +3514,9 @@ int HGraph::SourcePositionToScriptPosition(HSourcePosition pos) { |
| return pos.raw(); |
| } |
| - const int id = inlining_id_to_function_id_[pos.inlining_id()]; |
| - return inlined_functions_[id].start_position() + pos.position(); |
| + const int id = info()->inlining_id_to_function_id()->at(pos.inlining_id()); |
| + return info()->inlined_function_infos()->at(id).start_position() + |
| + pos.position(); |
| } |