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