| 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
| 8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
| 9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 for (int p = 0; p != properties_length; p += 2) { | 23 for (int p = 0; p != properties_length; p += 2) { |
| 24 Object* key = constant_properties->get(p); | 24 Object* key = constant_properties->get(p); |
| 25 uint32_t element_index = 0; | 25 uint32_t element_index = 0; |
| 26 if (key->ToArrayIndex(&element_index)) { | 26 if (key->ToArrayIndex(&element_index)) { |
| 27 // An index key does not require space in the property backing store. | 27 // An index key does not require space in the property backing store. |
| 28 number_of_properties--; | 28 number_of_properties--; |
| 29 } | 29 } |
| 30 } | 30 } |
| 31 Isolate* isolate = context->GetIsolate(); | 31 Isolate* isolate = context->GetIsolate(); |
| 32 return isolate->factory()->ObjectLiteralMapFromCache( | 32 return isolate->factory()->ObjectLiteralMapFromCache( |
| 33 context, number_of_properties, false, is_result_from_cache); | 33 context, number_of_properties, is_result_from_cache); |
| 34 } | 34 } |
| 35 | 35 |
| 36 MUST_USE_RESULT static MaybeHandle<Object> CreateLiteralBoilerplate( | 36 MUST_USE_RESULT static MaybeHandle<Object> CreateLiteralBoilerplate( |
| 37 Isolate* isolate, Handle<LiteralsArray> literals, | 37 Isolate* isolate, Handle<LiteralsArray> literals, |
| 38 Handle<FixedArray> constant_properties); | 38 Handle<FixedArray> constant_properties); |
| 39 | 39 |
| 40 MUST_USE_RESULT static MaybeHandle<Object> CreateObjectLiteralBoilerplate( | 40 MUST_USE_RESULT static MaybeHandle<Object> CreateObjectLiteralBoilerplate( |
| 41 Isolate* isolate, Handle<LiteralsArray> literals, | 41 Isolate* isolate, Handle<LiteralsArray> literals, |
| 42 Handle<FixedArray> constant_properties, bool should_have_fast_elements, | 42 Handle<FixedArray> constant_properties, bool should_have_fast_elements, |
| 43 bool has_function_literal) { | 43 bool has_function_literal) { |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 Handle<LiteralsArray> literals(closure->literals(), isolate); | 382 Handle<LiteralsArray> literals(closure->literals(), isolate); |
| 383 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 383 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 384 isolate, result, | 384 isolate, result, |
| 385 CreateArrayLiteralImpl(isolate, literals, literals_index, elements, | 385 CreateArrayLiteralImpl(isolate, literals, literals_index, elements, |
| 386 ArrayLiteral::kShallowElements)); | 386 ArrayLiteral::kShallowElements)); |
| 387 return *result; | 387 return *result; |
| 388 } | 388 } |
| 389 | 389 |
| 390 } // namespace internal | 390 } // namespace internal |
| 391 } // namespace v8 | 391 } // namespace v8 |
| OLD | NEW |