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 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 DCHECK(!cached.code->marked_for_deoptimization()); | 1335 DCHECK(!cached.code->marked_for_deoptimization()); |
1336 DCHECK(result->shared()->is_compiled()); | 1336 DCHECK(result->shared()->is_compiled()); |
1337 result->ReplaceCode(cached.code); | 1337 result->ReplaceCode(cached.code); |
1338 } | 1338 } |
1339 | 1339 |
1340 if (cached.literals != nullptr) { | 1340 if (cached.literals != nullptr) { |
1341 result->set_literals(cached.literals); | 1341 result->set_literals(cached.literals); |
1342 | 1342 |
1343 } else if (!info->bound()) { | 1343 } else if (!info->bound()) { |
1344 int number_of_literals = info->num_literals(); | 1344 int number_of_literals = info->num_literals(); |
1345 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure); | 1345 Handle<LiteralsArray> literals = |
| 1346 LiteralsArray::New(isolate(), handle(info->feedback_vector()), |
| 1347 number_of_literals, pretenure); |
1346 result->set_literals(*literals); | 1348 result->set_literals(*literals); |
1347 // Cache context-specific literals. | 1349 // Cache context-specific literals. |
1348 if (FLAG_cache_optimized_code) { | 1350 if (FLAG_cache_optimized_code) { |
1349 Handle<Context> native_context(context->native_context()); | 1351 Handle<Context> native_context(context->native_context()); |
1350 SharedFunctionInfo::AddToOptimizedCodeMap( | 1352 SharedFunctionInfo::AddToOptimizedCodeMap( |
1351 info, native_context, undefined_value(), literals, BailoutId::None()); | 1353 info, native_context, undefined_value(), literals, BailoutId::None()); |
1352 } | 1354 } |
1353 } | 1355 } |
1354 | 1356 |
1355 return result; | 1357 return result; |
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2392 } | 2394 } |
2393 | 2395 |
2394 | 2396 |
2395 Handle<Object> Factory::ToBoolean(bool value) { | 2397 Handle<Object> Factory::ToBoolean(bool value) { |
2396 return value ? true_value() : false_value(); | 2398 return value ? true_value() : false_value(); |
2397 } | 2399 } |
2398 | 2400 |
2399 | 2401 |
2400 } // namespace internal | 2402 } // namespace internal |
2401 } // namespace v8 | 2403 } // namespace v8 |
OLD | NEW |