OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 | 1242 |
1243 Handle<SharedFunctionInfo> shared = info->shared_info(); | 1243 Handle<SharedFunctionInfo> shared = info->shared_info(); |
1244 if (shared->code()->kind() != Code::FUNCTION || | 1244 if (shared->code()->kind() != Code::FUNCTION || |
1245 ScopeInfo::Empty(isolate) == shared->scope_info()) { | 1245 ScopeInfo::Empty(isolate) == shared->scope_info()) { |
1246 // The function was never compiled. Compile it unoptimized first. | 1246 // The function was never compiled. Compile it unoptimized first. |
1247 CompilationInfoWithZone nested(function); | 1247 CompilationInfoWithZone nested(function); |
1248 nested.EnableDeoptimizationSupport(); | 1248 nested.EnableDeoptimizationSupport(); |
1249 if (!GetUnoptimizedCodeCommon(&nested).ToHandle(¤t_code)) { | 1249 if (!GetUnoptimizedCodeCommon(&nested).ToHandle(¤t_code)) { |
1250 return MaybeHandle<Code>(); | 1250 return MaybeHandle<Code>(); |
1251 } | 1251 } |
| 1252 shared->ReplaceCode(*current_code); |
1252 } | 1253 } |
1253 int compiled_size = shared->end_position() - shared->start_position(); | 1254 int compiled_size = shared->end_position() - shared->start_position(); |
1254 isolate->counters()->total_compile_size()->Increment(compiled_size); | 1255 isolate->counters()->total_compile_size()->Increment(compiled_size); |
1255 current_code->set_profiler_ticks(0); | 1256 current_code->set_profiler_ticks(0); |
1256 | 1257 |
1257 info->SetOptimizing(osr_ast_id, current_code); | 1258 info->SetOptimizing(osr_ast_id, current_code); |
1258 | 1259 |
1259 if (mode == CONCURRENT) { | 1260 if (mode == CONCURRENT) { |
1260 if (GetOptimizedCodeLater(info.get())) { | 1261 if (GetOptimizedCodeLater(info.get())) { |
1261 info.Detach(); // The background recompile job owns this now. | 1262 info.Detach(); // The background recompile job owns this now. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 AllowHandleDereference allow_deref; | 1383 AllowHandleDereference allow_deref; |
1383 bool tracing_on = info()->IsStub() | 1384 bool tracing_on = info()->IsStub() |
1384 ? FLAG_trace_hydrogen_stubs | 1385 ? FLAG_trace_hydrogen_stubs |
1385 : (FLAG_trace_hydrogen && | 1386 : (FLAG_trace_hydrogen && |
1386 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1387 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1387 return (tracing_on && | 1388 return (tracing_on && |
1388 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1389 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1389 } | 1390 } |
1390 | 1391 |
1391 } } // namespace v8::internal | 1392 } } // namespace v8::internal |
OLD | NEW |