| 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 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1398 | 1398 |
| 1399 // Create a shared function info object. | 1399 // Create a shared function info object. |
| 1400 Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo( | 1400 Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo( |
| 1401 literal->name(), literal->materialized_literal_count(), literal->kind(), | 1401 literal->name(), literal->materialized_literal_count(), literal->kind(), |
| 1402 info.code(), scope_info, info.feedback_vector()); | 1402 info.code(), scope_info, info.feedback_vector()); |
| 1403 | 1403 |
| 1404 SharedFunctionInfo::InitFromFunctionLiteral(result, literal); | 1404 SharedFunctionInfo::InitFromFunctionLiteral(result, literal); |
| 1405 result->set_script(*script); | 1405 result->set_script(*script); |
| 1406 result->set_is_toplevel(false); | 1406 result->set_is_toplevel(false); |
| 1407 | 1407 |
| 1408 if (literal->scope()->new_target_var() != nullptr) { |
| 1409 Handle<Code> stub(isolate->builtins()->JSConstructStubNewTarget()); |
| 1410 result->set_construct_stub(*stub); |
| 1411 } |
| 1412 |
| 1408 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result); | 1413 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result); |
| 1409 result->set_allows_lazy_compilation(literal->AllowsLazyCompilation()); | 1414 result->set_allows_lazy_compilation(literal->AllowsLazyCompilation()); |
| 1410 result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx); | 1415 result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx); |
| 1411 | 1416 |
| 1412 // Set the expected number of properties for instances and return | 1417 // Set the expected number of properties for instances and return |
| 1413 // the resulting function. | 1418 // the resulting function. |
| 1414 SetExpectedNofPropertiesFromEstimate(result, | 1419 SetExpectedNofPropertiesFromEstimate(result, |
| 1415 literal->expected_property_count()); | 1420 literal->expected_property_count()); |
| 1416 live_edit_tracker.RecordFunctionInfo(result, literal, info.zone()); | 1421 live_edit_tracker.RecordFunctionInfo(result, literal, info.zone()); |
| 1417 return result; | 1422 return result; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1568 | 1573 |
| 1569 | 1574 |
| 1570 #if DEBUG | 1575 #if DEBUG |
| 1571 void CompilationInfo::PrintAstForTesting() { | 1576 void CompilationInfo::PrintAstForTesting() { |
| 1572 PrintF("--- Source from AST ---\n%s\n", | 1577 PrintF("--- Source from AST ---\n%s\n", |
| 1573 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1578 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
| 1574 } | 1579 } |
| 1575 #endif | 1580 #endif |
| 1576 } // namespace internal | 1581 } // namespace internal |
| 1577 } // namespace v8 | 1582 } // namespace v8 |
| OLD | NEW |