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/compiler.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
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 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 // In that case the vector will be replaced the next time MakeCode is | 1364 // In that case the vector will be replaced the next time MakeCode is |
1365 // called. | 1365 // called. |
1366 info.EnsureFeedbackVector(); | 1366 info.EnsureFeedbackVector(); |
1367 scope_info = Handle<ScopeInfo>(ScopeInfo::Empty(isolate)); | 1367 scope_info = Handle<ScopeInfo>(ScopeInfo::Empty(isolate)); |
1368 } else if (Renumber(info.parse_info()) && | 1368 } else if (Renumber(info.parse_info()) && |
1369 FullCodeGenerator::MakeCode(&info)) { | 1369 FullCodeGenerator::MakeCode(&info)) { |
1370 // MakeCode will ensure that the feedback vector is present and | 1370 // MakeCode will ensure that the feedback vector is present and |
1371 // appropriately sized. | 1371 // appropriately sized. |
1372 DCHECK(!info.code().is_null()); | 1372 DCHECK(!info.code().is_null()); |
1373 scope_info = ScopeInfo::Create(info.isolate(), info.zone(), info.scope()); | 1373 scope_info = ScopeInfo::Create(info.isolate(), info.zone(), info.scope()); |
| 1374 if (literal->should_eager_compile() && |
| 1375 literal->should_be_used_once_hint()) { |
| 1376 info.code()->MarkToBeExecutedOnce(isolate); |
| 1377 } |
1374 } else { | 1378 } else { |
1375 return Handle<SharedFunctionInfo>::null(); | 1379 return Handle<SharedFunctionInfo>::null(); |
1376 } | 1380 } |
1377 | 1381 |
1378 // Create a shared function info object. | 1382 // Create a shared function info object. |
1379 Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo( | 1383 Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo( |
1380 literal->name(), literal->materialized_literal_count(), literal->kind(), | 1384 literal->name(), literal->materialized_literal_count(), literal->kind(), |
1381 info.code(), scope_info, info.feedback_vector()); | 1385 info.code(), scope_info, info.feedback_vector()); |
1382 | 1386 |
1383 SharedFunctionInfo::InitFromFunctionLiteral(result, literal); | 1387 SharedFunctionInfo::InitFromFunctionLiteral(result, literal); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 } | 1550 } |
1547 | 1551 |
1548 | 1552 |
1549 #if DEBUG | 1553 #if DEBUG |
1550 void CompilationInfo::PrintAstForTesting() { | 1554 void CompilationInfo::PrintAstForTesting() { |
1551 PrintF("--- Source from AST ---\n%s\n", | 1555 PrintF("--- Source from AST ---\n%s\n", |
1552 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1556 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1553 } | 1557 } |
1554 #endif | 1558 #endif |
1555 } } // namespace v8::internal | 1559 } } // namespace v8::internal |
OLD | NEW |