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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 // Create a shared function info object. | 1421 // Create a shared function info object. |
1422 Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo( | 1422 Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo( |
1423 literal->name(), literal->materialized_literal_count(), literal->kind(), | 1423 literal->name(), literal->materialized_literal_count(), literal->kind(), |
1424 info.code(), scope_info, info.feedback_vector()); | 1424 info.code(), scope_info, info.feedback_vector()); |
1425 | 1425 |
1426 SharedFunctionInfo::InitFromFunctionLiteral(result, literal); | 1426 SharedFunctionInfo::InitFromFunctionLiteral(result, literal); |
1427 result->set_script(*script); | 1427 result->set_script(*script); |
1428 result->set_is_toplevel(false); | 1428 result->set_is_toplevel(false); |
1429 | 1429 |
1430 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result); | 1430 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result); |
1431 result->set_allows_lazy_compilation(allow_lazy); | 1431 result->set_allows_lazy_compilation(literal->AllowsLazyCompilation()); |
1432 result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx); | 1432 result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx); |
1433 | 1433 |
1434 // Set the expected number of properties for instances and return | 1434 // Set the expected number of properties for instances and return |
1435 // the resulting function. | 1435 // the resulting function. |
1436 SetExpectedNofPropertiesFromEstimate(result, | 1436 SetExpectedNofPropertiesFromEstimate(result, |
1437 literal->expected_property_count()); | 1437 literal->expected_property_count()); |
1438 live_edit_tracker.RecordFunctionInfo(result, literal, info.zone()); | 1438 live_edit_tracker.RecordFunctionInfo(result, literal, info.zone()); |
1439 return result; | 1439 return result; |
1440 } | 1440 } |
1441 | 1441 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 } | 1577 } |
1578 | 1578 |
1579 | 1579 |
1580 #if DEBUG | 1580 #if DEBUG |
1581 void CompilationInfo::PrintAstForTesting() { | 1581 void CompilationInfo::PrintAstForTesting() { |
1582 PrintF("--- Source from AST ---\n%s\n", | 1582 PrintF("--- Source from AST ---\n%s\n", |
1583 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1583 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1584 } | 1584 } |
1585 #endif | 1585 #endif |
1586 } } // namespace v8::internal | 1586 } } // namespace v8::internal |
OLD | NEW |