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 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 if (cached.literals != nullptr) { | 1366 if (cached.literals != nullptr) { |
1367 result->set_literals(cached.literals); | 1367 result->set_literals(cached.literals); |
1368 } else { | 1368 } else { |
1369 int number_of_literals = info->num_literals(); | 1369 int number_of_literals = info->num_literals(); |
1370 Handle<LiteralsArray> literals = | 1370 Handle<LiteralsArray> literals = |
1371 LiteralsArray::New(isolate(), handle(info->feedback_vector()), | 1371 LiteralsArray::New(isolate(), handle(info->feedback_vector()), |
1372 number_of_literals, pretenure); | 1372 number_of_literals, pretenure); |
1373 result->set_literals(*literals); | 1373 result->set_literals(*literals); |
1374 | 1374 |
1375 // Cache context-specific literals. | 1375 // Cache context-specific literals. |
| 1376 MaybeHandle<Code> code; |
| 1377 if (cached.code != nullptr) code = handle(cached.code); |
1376 Handle<Context> native_context(context->native_context()); | 1378 Handle<Context> native_context(context->native_context()); |
1377 SharedFunctionInfo::AddLiteralsToOptimizedCodeMap(info, native_context, | 1379 SharedFunctionInfo::AddToOptimizedCodeMap(info, native_context, code, |
1378 literals); | 1380 literals, BailoutId::None()); |
1379 } | 1381 } |
1380 | 1382 |
1381 return result; | 1383 return result; |
1382 } | 1384 } |
1383 | 1385 |
1384 | 1386 |
1385 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { | 1387 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { |
1386 Handle<FixedArray> array = NewFixedArray(length, TENURED); | 1388 Handle<FixedArray> array = NewFixedArray(length, TENURED); |
1387 array->set_map_no_write_barrier(*scope_info_map()); | 1389 array->set_map_no_write_barrier(*scope_info_map()); |
1388 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast(array); | 1390 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast(array); |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2383 } | 2385 } |
2384 | 2386 |
2385 | 2387 |
2386 Handle<Object> Factory::ToBoolean(bool value) { | 2388 Handle<Object> Factory::ToBoolean(bool value) { |
2387 return value ? true_value() : false_value(); | 2389 return value ? true_value() : false_value(); |
2388 } | 2390 } |
2389 | 2391 |
2390 | 2392 |
2391 } // namespace internal | 2393 } // namespace internal |
2392 } // namespace v8 | 2394 } // namespace v8 |
OLD | NEW |