OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/factory.h" | 5 #include "src/factory.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 if (cached.code != nullptr) { | 1383 if (cached.code != nullptr) { |
1384 // Caching of optimized code enabled and optimized code found. | 1384 // Caching of optimized code enabled and optimized code found. |
1385 if (cached.literals != nullptr) result->set_literals(cached.literals); | 1385 if (cached.literals != nullptr) result->set_literals(cached.literals); |
1386 DCHECK(!cached.code->marked_for_deoptimization()); | 1386 DCHECK(!cached.code->marked_for_deoptimization()); |
1387 DCHECK(result->shared()->is_compiled()); | 1387 DCHECK(result->shared()->is_compiled()); |
1388 result->ReplaceCode(cached.code); | 1388 result->ReplaceCode(cached.code); |
1389 } | 1389 } |
1390 | 1390 |
1391 if (cached.literals == nullptr && !info->bound()) { | 1391 if (cached.literals == nullptr && !info->bound()) { |
1392 int number_of_literals = info->num_literals(); | 1392 int number_of_literals = info->num_literals(); |
| 1393 // TODO(mstarzinger): Consider sharing the newly created literals array. |
1393 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure); | 1394 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure); |
1394 result->set_literals(*literals); | 1395 result->set_literals(*literals); |
1395 } | 1396 } |
1396 | 1397 |
1397 return result; | 1398 return result; |
1398 } | 1399 } |
1399 | 1400 |
1400 | 1401 |
1401 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { | 1402 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { |
1402 Handle<FixedArray> array = NewFixedArray(length, TENURED); | 1403 Handle<FixedArray> array = NewFixedArray(length, TENURED); |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2429 } | 2430 } |
2430 | 2431 |
2431 | 2432 |
2432 Handle<Object> Factory::ToBoolean(bool value) { | 2433 Handle<Object> Factory::ToBoolean(bool value) { |
2433 return value ? true_value() : false_value(); | 2434 return value ? true_value() : false_value(); |
2434 } | 2435 } |
2435 | 2436 |
2436 | 2437 |
2437 } // namespace internal | 2438 } // namespace internal |
2438 } // namespace v8 | 2439 } // namespace v8 |
OLD | NEW |