Index: src/runtime/runtime-literals.cc |
diff --git a/src/runtime/runtime-literals.cc b/src/runtime/runtime-literals.cc |
index 113193835d9852765363f1fb529ea657c8bb39f8..903e2feb53b1d2deb5b4f0e4bda56237b326b414 100644 |
--- a/src/runtime/runtime-literals.cc |
+++ b/src/runtime/runtime-literals.cc |
@@ -34,12 +34,12 @@ static Handle<Map> ComputeObjectLiteralMap( |
} |
MUST_USE_RESULT static MaybeHandle<Object> CreateLiteralBoilerplate( |
- Isolate* isolate, Handle<FixedArray> literals, |
+ Isolate* isolate, Handle<LiteralsArray> literals, |
Handle<FixedArray> constant_properties, bool is_strong); |
MUST_USE_RESULT static MaybeHandle<Object> CreateObjectLiteralBoilerplate( |
- Isolate* isolate, Handle<FixedArray> literals, |
+ Isolate* isolate, Handle<LiteralsArray> literals, |
Handle<FixedArray> constant_properties, bool should_have_fast_elements, |
bool has_function_literal, bool is_strong) { |
Handle<Context> context = isolate->native_context(); |
@@ -139,7 +139,7 @@ MUST_USE_RESULT static MaybeHandle<Object> CreateObjectLiteralBoilerplate( |
MaybeHandle<Object> Runtime::CreateArrayLiteralBoilerplate( |
- Isolate* isolate, Handle<FixedArray> literals, |
+ Isolate* isolate, Handle<LiteralsArray> literals, |
Handle<FixedArray> elements, bool is_strong) { |
// Create the JSArray. |
Handle<JSFunction> constructor = isolate->array_function(); |
@@ -215,7 +215,7 @@ MaybeHandle<Object> Runtime::CreateArrayLiteralBoilerplate( |
MUST_USE_RESULT static MaybeHandle<Object> CreateLiteralBoilerplate( |
- Isolate* isolate, Handle<FixedArray> literals, Handle<FixedArray> array, |
+ Isolate* isolate, Handle<LiteralsArray> literals, Handle<FixedArray> array, |
bool is_strong) { |
Handle<FixedArray> elements = CompileTimeValue::GetElements(array); |
const bool kHasNoFunctionLiteral = false; |
@@ -239,7 +239,7 @@ MUST_USE_RESULT static MaybeHandle<Object> CreateLiteralBoilerplate( |
RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) { |
HandleScope scope(isolate); |
DCHECK(args.length() == 4); |
- CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(LiteralsArray, literals, 0); |
CONVERT_SMI_ARG_CHECKED(literals_index, 1); |
CONVERT_ARG_HANDLE_CHECKED(FixedArray, constant_properties, 2); |
CONVERT_SMI_ARG_CHECKED(flags, 3); |
@@ -248,10 +248,11 @@ RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) { |
bool enable_mementos = (flags & ObjectLiteral::kDisableMementos) == 0; |
bool is_strong = (flags & ObjectLiteral::kIsStrong) != 0; |
- RUNTIME_ASSERT(literals_index >= 0 && literals_index < literals->length()); |
+ RUNTIME_ASSERT(literals_index >= 0 && |
+ literals_index < literals->literals_count()); |
// Check if boilerplate exists. If not, create it first. |
- Handle<Object> literal_site(literals->get(literals_index), isolate); |
+ Handle<Object> literal_site(literals->literal(literals_index), isolate); |
Handle<AllocationSite> site; |
Handle<JSObject> boilerplate; |
if (*literal_site == isolate->heap()->undefined_value()) { |
@@ -270,7 +271,7 @@ RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) { |
creation_context.ExitScope(site, boilerplate); |
// Update the functions literal and return the boilerplate. |
- literals->set(literals_index, *site); |
+ literals->set_literal(literals_index, *site); |
} else { |
site = Handle<AllocationSite>::cast(literal_site); |
boilerplate = |
@@ -289,10 +290,10 @@ RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) { |
MUST_USE_RESULT static MaybeHandle<AllocationSite> GetLiteralAllocationSite( |
- Isolate* isolate, Handle<FixedArray> literals, int literals_index, |
+ Isolate* isolate, Handle<LiteralsArray> literals, int literals_index, |
Handle<FixedArray> elements, bool is_strong) { |
// Check if boilerplate exists. If not, create it first. |
- Handle<Object> literal_site(literals->get(literals_index), isolate); |
+ Handle<Object> literal_site(literals->literal(literals_index), isolate); |
Handle<AllocationSite> site; |
if (*literal_site == isolate->heap()->undefined_value()) { |
DCHECK(*elements != isolate->heap()->empty_fixed_array()); |
@@ -311,7 +312,7 @@ MUST_USE_RESULT static MaybeHandle<AllocationSite> GetLiteralAllocationSite( |
} |
creation_context.ExitScope(site, Handle<JSObject>::cast(boilerplate)); |
- literals->set(literals_index, *site); |
+ literals->set_literal(literals_index, *site); |
} else { |
site = Handle<AllocationSite>::cast(literal_site); |
} |
@@ -320,13 +321,12 @@ MUST_USE_RESULT static MaybeHandle<AllocationSite> GetLiteralAllocationSite( |
} |
-static MaybeHandle<JSObject> CreateArrayLiteralImpl(Isolate* isolate, |
- Handle<FixedArray> literals, |
- int literals_index, |
- Handle<FixedArray> elements, |
- int flags) { |
+static MaybeHandle<JSObject> CreateArrayLiteralImpl( |
+ Isolate* isolate, Handle<LiteralsArray> literals, int literals_index, |
+ Handle<FixedArray> elements, int flags) { |
RUNTIME_ASSERT_HANDLIFIED( |
- literals_index >= 0 && literals_index < literals->length(), JSObject); |
+ literals_index >= 0 && literals_index < literals->literals_count(), |
+ JSObject); |
Handle<AllocationSite> site; |
bool is_strong = (flags & ArrayLiteral::kIsStrong) != 0; |
ASSIGN_RETURN_ON_EXCEPTION( |
@@ -352,7 +352,7 @@ static MaybeHandle<JSObject> CreateArrayLiteralImpl(Isolate* isolate, |
RUNTIME_FUNCTION(Runtime_CreateArrayLiteral) { |
HandleScope scope(isolate); |
DCHECK(args.length() == 4); |
- CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(LiteralsArray, literals, 0); |
CONVERT_SMI_ARG_CHECKED(literals_index, 1); |
CONVERT_ARG_HANDLE_CHECKED(FixedArray, elements, 2); |
CONVERT_SMI_ARG_CHECKED(flags, 3); |
@@ -368,7 +368,7 @@ RUNTIME_FUNCTION(Runtime_CreateArrayLiteral) { |
RUNTIME_FUNCTION(Runtime_CreateArrayLiteralStubBailout) { |
HandleScope scope(isolate); |
DCHECK(args.length() == 3); |
- CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(LiteralsArray, literals, 0); |
CONVERT_SMI_ARG_CHECKED(literals_index, 1); |
CONVERT_ARG_HANDLE_CHECKED(FixedArray, elements, 2); |
@@ -387,10 +387,10 @@ RUNTIME_FUNCTION(Runtime_StoreArrayLiteralElement) { |
CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
CONVERT_SMI_ARG_CHECKED(store_index, 1); |
CONVERT_ARG_HANDLE_CHECKED(Object, value, 2); |
- CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 3); |
+ CONVERT_ARG_HANDLE_CHECKED(LiteralsArray, literals, 3); |
CONVERT_SMI_ARG_CHECKED(literal_index, 4); |
- Object* raw_literal_cell = literals->get(literal_index); |
+ Object* raw_literal_cell = literals->literal(literal_index); |
JSArray* boilerplate = NULL; |
if (raw_literal_cell->IsAllocationSite()) { |
AllocationSite* site = AllocationSite::cast(raw_literal_cell); |