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 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/asmjs/asm-js.h" | 10 #include "src/asmjs/asm-js.h" |
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 // If caller is strict mode, the result must be in strict mode as well. | 1448 // If caller is strict mode, the result must be in strict mode as well. |
1449 DCHECK(is_sloppy(language_mode) || is_strict(shared_info->language_mode())); | 1449 DCHECK(is_sloppy(language_mode) || is_strict(shared_info->language_mode())); |
1450 | 1450 |
1451 Handle<JSFunction> result; | 1451 Handle<JSFunction> result; |
1452 if (eval_result.has_shared()) { | 1452 if (eval_result.has_shared()) { |
1453 if (eval_result.has_vector()) { | 1453 if (eval_result.has_vector()) { |
1454 result = isolate->factory()->NewFunctionFromSharedFunctionInfo( | 1454 result = isolate->factory()->NewFunctionFromSharedFunctionInfo( |
1455 shared_info, context, vector, NOT_TENURED); | 1455 shared_info, context, vector, NOT_TENURED); |
1456 } else { | 1456 } else { |
1457 result = isolate->factory()->NewFunctionFromSharedFunctionInfo( | 1457 result = isolate->factory()->NewFunctionFromSharedFunctionInfo( |
1458 shared_info, context, isolate->factory()->undefined_cell(), | 1458 shared_info, context, NOT_TENURED); |
1459 NOT_TENURED); | |
1460 JSFunction::EnsureLiterals(result); | 1459 JSFunction::EnsureLiterals(result); |
1461 // Make sure to cache this result. | 1460 // Make sure to cache this result. |
1462 Handle<Cell> new_vector(result->feedback_vector_cell(), isolate); | 1461 Handle<Cell> new_vector(result->feedback_vector_cell(), isolate); |
1463 compilation_cache->PutEval(source, outer_info, context, shared_info, | 1462 compilation_cache->PutEval(source, outer_info, context, shared_info, |
1464 new_vector, eval_scope_position); | 1463 new_vector, eval_scope_position); |
1465 } | 1464 } |
1466 } else { | 1465 } else { |
1467 result = isolate->factory()->NewFunctionFromSharedFunctionInfo( | 1466 result = isolate->factory()->NewFunctionFromSharedFunctionInfo( |
1468 shared_info, context, NOT_TENURED); | 1467 shared_info, context, NOT_TENURED); |
1469 JSFunction::EnsureLiterals(result); | 1468 JSFunction::EnsureLiterals(result); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1829 } | 1828 } |
1830 | 1829 |
1831 if (shared->is_compiled()) { | 1830 if (shared->is_compiled()) { |
1832 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1831 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1833 JSFunction::EnsureLiterals(function); | 1832 JSFunction::EnsureLiterals(function); |
1834 } | 1833 } |
1835 } | 1834 } |
1836 | 1835 |
1837 } // namespace internal | 1836 } // namespace internal |
1838 } // namespace v8 | 1837 } // namespace v8 |
OLD | NEW |