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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 } | 1379 } |
1380 | 1380 |
1381 SmartPointer<CompilationInfo> info(new CompilationInfoWithZone(function)); | 1381 SmartPointer<CompilationInfo> info(new CompilationInfoWithZone(function)); |
1382 Isolate* isolate = info->isolate(); | 1382 Isolate* isolate = info->isolate(); |
1383 DCHECK(AllowCompilation::IsAllowed(isolate)); | 1383 DCHECK(AllowCompilation::IsAllowed(isolate)); |
1384 VMState<COMPILER> state(isolate); | 1384 VMState<COMPILER> state(isolate); |
1385 DCHECK(!isolate->has_pending_exception()); | 1385 DCHECK(!isolate->has_pending_exception()); |
1386 PostponeInterruptsScope postpone(isolate); | 1386 PostponeInterruptsScope postpone(isolate); |
1387 | 1387 |
1388 Handle<SharedFunctionInfo> shared = info->shared_info(); | 1388 Handle<SharedFunctionInfo> shared = info->shared_info(); |
1389 shared->set_optimize_next_closure(false); | |
1390 if (shared->code()->kind() != Code::FUNCTION || | 1389 if (shared->code()->kind() != Code::FUNCTION || |
1391 ScopeInfo::Empty(isolate) == shared->scope_info()) { | 1390 ScopeInfo::Empty(isolate) == shared->scope_info()) { |
1392 // The function was never compiled. Compile it unoptimized first. | 1391 // The function was never compiled. Compile it unoptimized first. |
1393 // TODO(titzer): reuse the AST and scope info from this compile. | 1392 // TODO(titzer): reuse the AST and scope info from this compile. |
1394 CompilationInfoWithZone nested(function); | 1393 CompilationInfoWithZone nested(function); |
1395 nested.EnableDeoptimizationSupport(); | 1394 nested.EnableDeoptimizationSupport(); |
1396 if (!GetUnoptimizedCodeCommon(&nested).ToHandle(¤t_code)) { | 1395 if (!GetUnoptimizedCodeCommon(&nested).ToHandle(¤t_code)) { |
1397 return MaybeHandle<Code>(); | 1396 return MaybeHandle<Code>(); |
1398 } | 1397 } |
1399 shared->ReplaceCode(*current_code); | 1398 shared->ReplaceCode(*current_code); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 AllowHandleDereference allow_deref; | 1498 AllowHandleDereference allow_deref; |
1500 bool tracing_on = info()->IsStub() | 1499 bool tracing_on = info()->IsStub() |
1501 ? FLAG_trace_hydrogen_stubs | 1500 ? FLAG_trace_hydrogen_stubs |
1502 : (FLAG_trace_hydrogen && | 1501 : (FLAG_trace_hydrogen && |
1503 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1502 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1504 return (tracing_on && | 1503 return (tracing_on && |
1505 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1504 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1506 } | 1505 } |
1507 | 1506 |
1508 } } // namespace v8::internal | 1507 } } // namespace v8::internal |
OLD | NEW |