| 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/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 } | 1354 } |
| 1355 | 1355 |
| 1356 SmartPointer<CompilationInfo> info(new CompilationInfoWithZone(function)); | 1356 SmartPointer<CompilationInfo> info(new CompilationInfoWithZone(function)); |
| 1357 Isolate* isolate = info->isolate(); | 1357 Isolate* isolate = info->isolate(); |
| 1358 DCHECK(AllowCompilation::IsAllowed(isolate)); | 1358 DCHECK(AllowCompilation::IsAllowed(isolate)); |
| 1359 VMState<COMPILER> state(isolate); | 1359 VMState<COMPILER> state(isolate); |
| 1360 DCHECK(!isolate->has_pending_exception()); | 1360 DCHECK(!isolate->has_pending_exception()); |
| 1361 PostponeInterruptsScope postpone(isolate); | 1361 PostponeInterruptsScope postpone(isolate); |
| 1362 | 1362 |
| 1363 Handle<SharedFunctionInfo> shared = info->shared_info(); | 1363 Handle<SharedFunctionInfo> shared = info->shared_info(); |
| 1364 shared->set_optimize_next_closure(false); |
| 1364 if (shared->code()->kind() != Code::FUNCTION || | 1365 if (shared->code()->kind() != Code::FUNCTION || |
| 1365 ScopeInfo::Empty(isolate) == shared->scope_info()) { | 1366 ScopeInfo::Empty(isolate) == shared->scope_info()) { |
| 1366 // The function was never compiled. Compile it unoptimized first. | 1367 // The function was never compiled. Compile it unoptimized first. |
| 1367 // TODO(titzer): reuse the AST and scope info from this compile. | 1368 // TODO(titzer): reuse the AST and scope info from this compile. |
| 1368 CompilationInfoWithZone nested(function); | 1369 CompilationInfoWithZone nested(function); |
| 1369 nested.EnableDeoptimizationSupport(); | 1370 nested.EnableDeoptimizationSupport(); |
| 1370 if (!GetUnoptimizedCodeCommon(&nested).ToHandle(¤t_code)) { | 1371 if (!GetUnoptimizedCodeCommon(&nested).ToHandle(¤t_code)) { |
| 1371 return MaybeHandle<Code>(); | 1372 return MaybeHandle<Code>(); |
| 1372 } | 1373 } |
| 1373 shared->ReplaceCode(*current_code); | 1374 shared->ReplaceCode(*current_code); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1473 AllowHandleDereference allow_deref; | 1474 AllowHandleDereference allow_deref; |
| 1474 bool tracing_on = info()->IsStub() | 1475 bool tracing_on = info()->IsStub() |
| 1475 ? FLAG_trace_hydrogen_stubs | 1476 ? FLAG_trace_hydrogen_stubs |
| 1476 : (FLAG_trace_hydrogen && | 1477 : (FLAG_trace_hydrogen && |
| 1477 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1478 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
| 1478 return (tracing_on && | 1479 return (tracing_on && |
| 1479 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1480 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
| 1480 } | 1481 } |
| 1481 | 1482 |
| 1482 } } // namespace v8::internal | 1483 } } // namespace v8::internal |
| OLD | NEW |