 Chromium Code Reviews
 Chromium Code Reviews Issue 1374723002:
  Introduce LiteralsArray to hide it's implementation.  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master
    
  
    Issue 1374723002:
  Introduce LiteralsArray to hide it's implementation.  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master| 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 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1317 DCHECK(!cached.code->marked_for_deoptimization()); | 1317 DCHECK(!cached.code->marked_for_deoptimization()); | 
| 1318 DCHECK(result->shared()->is_compiled()); | 1318 DCHECK(result->shared()->is_compiled()); | 
| 1319 result->ReplaceCode(cached.code); | 1319 result->ReplaceCode(cached.code); | 
| 1320 } | 1320 } | 
| 1321 | 1321 | 
| 1322 if (cached.literals != nullptr) { | 1322 if (cached.literals != nullptr) { | 
| 1323 result->set_literals(cached.literals); | 1323 result->set_literals(cached.literals); | 
| 1324 | 1324 | 
| 1325 } else if (!info->bound()) { | 1325 } else if (!info->bound()) { | 
| 1326 int number_of_literals = info->num_literals(); | 1326 int number_of_literals = info->num_literals(); | 
| 1327 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure); | 1327 Handle<LiteralsArray> literals = NewLiteralsArray( | 
| 1328 handle(info->feedback_vector()), number_of_literals, pretenure); | |
| 1328 result->set_literals(*literals); | 1329 result->set_literals(*literals); | 
| 1329 // Cache context-specific literals. | 1330 // Cache context-specific literals. | 
| 1330 if (FLAG_cache_optimized_code) { | 1331 if (FLAG_cache_optimized_code) { | 
| 1331 Handle<Context> native_context(context->native_context()); | 1332 Handle<Context> native_context(context->native_context()); | 
| 1332 SharedFunctionInfo::AddToOptimizedCodeMap( | 1333 SharedFunctionInfo::AddToOptimizedCodeMap( | 
| 1333 info, native_context, undefined_value(), literals, BailoutId::None()); | 1334 info, native_context, undefined_value(), literals, BailoutId::None()); | 
| 1334 } | 1335 } | 
| 1335 } | 1336 } | 
| 1336 | 1337 | 
| 1337 return result; | 1338 return result; | 
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2079 shared->set_kind(kind); | 2080 shared->set_kind(kind); | 
| 2080 shared->set_num_literals(number_of_literals); | 2081 shared->set_num_literals(number_of_literals); | 
| 2081 if (IsGeneratorFunction(kind)) { | 2082 if (IsGeneratorFunction(kind)) { | 
| 2082 shared->set_instance_class_name(isolate()->heap()->Generator_string()); | 2083 shared->set_instance_class_name(isolate()->heap()->Generator_string()); | 
| 2083 shared->DisableOptimization(kGenerator); | 2084 shared->DisableOptimization(kGenerator); | 
| 2084 } | 2085 } | 
| 2085 return shared; | 2086 return shared; | 
| 2086 } | 2087 } | 
| 2087 | 2088 | 
| 2088 | 2089 | 
| 2090 Handle<LiteralsArray> Factory::NewLiteralsArray( | |
| 
Igor Sheludko
2015/09/29 08:40:41
I think we don't need this method, just call Liter
 | |
| 2091 Handle<TypeFeedbackVector> vector, int number_of_literals, | |
| 2092 PretenureFlag pretenure) { | |
| 2093 return LiteralsArray::Allocate(isolate(), vector, number_of_literals, | |
| 2094 pretenure); | |
| 2095 } | |
| 2096 | |
| 2097 | |
| 2089 Handle<JSMessageObject> Factory::NewJSMessageObject( | 2098 Handle<JSMessageObject> Factory::NewJSMessageObject( | 
| 2090 MessageTemplate::Template message, Handle<Object> argument, | 2099 MessageTemplate::Template message, Handle<Object> argument, | 
| 2091 int start_position, int end_position, Handle<Object> script, | 2100 int start_position, int end_position, Handle<Object> script, | 
| 2092 Handle<Object> stack_frames) { | 2101 Handle<Object> stack_frames) { | 
| 2093 Handle<Map> map = message_object_map(); | 2102 Handle<Map> map = message_object_map(); | 
| 2094 Handle<JSMessageObject> message_obj = New<JSMessageObject>(map, NEW_SPACE); | 2103 Handle<JSMessageObject> message_obj = New<JSMessageObject>(map, NEW_SPACE); | 
| 2095 message_obj->set_properties(*empty_fixed_array(), SKIP_WRITE_BARRIER); | 2104 message_obj->set_properties(*empty_fixed_array(), SKIP_WRITE_BARRIER); | 
| 2096 message_obj->initialize_elements(); | 2105 message_obj->initialize_elements(); | 
| 2097 message_obj->set_elements(*empty_fixed_array(), SKIP_WRITE_BARRIER); | 2106 message_obj->set_elements(*empty_fixed_array(), SKIP_WRITE_BARRIER); | 
| 2098 message_obj->set_type(message); | 2107 message_obj->set_type(message); | 
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2374 } | 2383 } | 
| 2375 | 2384 | 
| 2376 | 2385 | 
| 2377 Handle<Object> Factory::ToBoolean(bool value) { | 2386 Handle<Object> Factory::ToBoolean(bool value) { | 
| 2378 return value ? true_value() : false_value(); | 2387 return value ? true_value() : false_value(); | 
| 2379 } | 2388 } | 
| 2380 | 2389 | 
| 2381 | 2390 | 
| 2382 } // namespace internal | 2391 } // namespace internal | 
| 2383 } // namespace v8 | 2392 } // namespace v8 | 
| OLD | NEW |