| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4a3300e commit abf86ad
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | #define V8_MAJOR_VERSION 5 | |
| 12 | 12 | #define V8_MINOR_VERSION 0 | |
| 13 | 13 | #define V8_BUILD_NUMBER 71 | |
| 14 | - #define V8_PATCH_LEVEL 54 | ||
| 14 | + #define V8_PATCH_LEVEL 55 | ||
| 15 | 15 | ||
| 16 | 16 | // Use 1 for candidates and 0 otherwise. | |
| 17 | 17 | // (Boolean macro values are not supported by all preprocessors.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6044,60 +6044,34 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { | |||
| 6044 | 6044 | Handle<AllocationSite> site; | |
| 6045 | 6045 | Handle<LiteralsArray> literals(environment()->closure()->literals(), | |
| 6046 | 6046 | isolate()); | |
| 6047 | - bool uninitialized = false; | ||
| 6048 | 6047 | Handle<Object> literals_cell(literals->literal(expr->literal_index()), | |
| 6049 | 6048 | isolate()); | |
| 6050 | 6049 | Handle<JSObject> boilerplate_object; | |
| 6051 | - if (literals_cell->IsUndefined()) { | ||
| 6052 | - uninitialized = true; | ||
| 6053 | - Handle<Object> raw_boilerplate; | ||
| 6054 | - ASSIGN_RETURN_ON_EXCEPTION_VALUE( | ||
| 6055 | - isolate(), raw_boilerplate, | ||
| 6056 | - Runtime::CreateArrayLiteralBoilerplate( | ||
| 6057 | - isolate(), literals, expr->constant_elements(), | ||
| 6058 | - is_strong(function_language_mode())), | ||
| 6059 | - Bailout(kArrayBoilerplateCreationFailed)); | ||
| 6060 | - | ||
| 6061 | - boilerplate_object = Handle<JSObject>::cast(raw_boilerplate); | ||
| 6062 | - AllocationSiteCreationContext creation_context(isolate()); | ||
| 6063 | - site = creation_context.EnterNewScope(); | ||
| 6064 | - if (JSObject::DeepWalk(boilerplate_object, &creation_context).is_null()) { | ||
| 6065 | - return Bailout(kArrayBoilerplateCreationFailed); | ||
| 6066 | - } | ||
| 6067 | - creation_context.ExitScope(site, boilerplate_object); | ||
| 6068 | - literals->set_literal(expr->literal_index(), *site); | ||
| 6069 | - | ||
| 6070 | - if (boilerplate_object->elements()->map() == | ||
| 6071 | - isolate()->heap()->fixed_cow_array_map()) { | ||
| 6072 | - isolate()->counters()->cow_arrays_created_runtime()->Increment(); | ||
| 6073 | - } | ||
| 6074 | - } else { | ||
| 6050 | + if (!literals_cell->IsUndefined()) { | ||
| 6075 | 6051 | DCHECK(literals_cell->IsAllocationSite()); | |
| 6076 | 6052 | site = Handle<AllocationSite>::cast(literals_cell); | |
| 6077 | 6053 | boilerplate_object = Handle<JSObject>( | |
| 6078 | 6054 | JSObject::cast(site->transition_info()), isolate()); | |
| 6079 | 6055 | } | |
| 6080 | 6056 | ||
| 6081 | - DCHECK(!boilerplate_object.is_null()); | ||
| 6082 | - DCHECK(site->SitePointsToLiteral()); | ||
| 6083 | - | ||
| 6084 | - ElementsKind boilerplate_elements_kind = | ||
| 6085 | - boilerplate_object->GetElementsKind(); | ||
| 6057 | + ElementsKind boilerplate_elements_kind = expr->constant_elements_kind(); | ||
| 6058 | + if (!boilerplate_object.is_null()) { | ||
| 6059 | + boilerplate_elements_kind = boilerplate_object->GetElementsKind(); | ||
| 6060 | + } | ||
| 6086 | 6061 | ||
| 6087 | 6062 | // Check whether to use fast or slow deep-copying for boilerplate. | |
| 6088 | 6063 | int max_properties = kMaxFastLiteralProperties; | |
| 6089 | - if (IsFastLiteral(boilerplate_object, | ||
| 6090 | - kMaxFastLiteralDepth, | ||
| 6064 | + if (!boilerplate_object.is_null() && | ||
| 6065 | + IsFastLiteral(boilerplate_object, kMaxFastLiteralDepth, | ||
| 6091 | 6066 | &max_properties)) { | |
| 6067 | + DCHECK(site->SitePointsToLiteral()); | ||
| 6092 | 6068 | AllocationSiteUsageContext site_context(isolate(), site, false); | |
| 6093 | 6069 | site_context.EnterNewScope(); | |
| 6094 | 6070 | literal = BuildFastLiteral(boilerplate_object, &site_context); | |
| 6095 | 6071 | site_context.ExitScope(site, boilerplate_object); | |
| 6096 | 6072 | } else { | |
| 6097 | 6073 | NoObservableSideEffectsScope no_effects(this); | |
| 6098 | - // Boilerplate already exists and constant elements are never accessed, | ||
| 6099 | - // pass an empty fixed array to the runtime function instead. | ||
| 6100 | - Handle<FixedArray> constants = isolate()->factory()->empty_fixed_array(); | ||
| 6074 | + Handle<FixedArray> constants = expr->constant_elements(); | ||
| 6101 | 6075 | int literal_index = expr->literal_index(); | |
| 6102 | 6076 | int flags = expr->ComputeFlags(true); | |
| 6103 | 6077 | ||
@@ -6108,7 +6082,9 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { | |||
| 6108 | 6082 | literal = Add<HCallRuntime>(Runtime::FunctionForId(function_id), 4); | |
| 6109 | 6083 | ||
| 6110 | 6084 | // Register to deopt if the boilerplate ElementsKind changes. | |
| 6111 | - top_info()->dependencies()->AssumeTransitionStable(site); | ||
| 6085 | + if (!site.is_null()) { | ||
| 6086 | + top_info()->dependencies()->AssumeTransitionStable(site); | ||
| 6087 | + } | ||
| 6112 | 6088 | } | |
| 6113 | 6089 | ||
| 6114 | 6090 | // The array is expected in the bailout environment during computation | |
@@ -6140,9 +6116,8 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { | |||
| 6140 | 6116 | case FAST_HOLEY_ELEMENTS: | |
| 6141 | 6117 | case FAST_DOUBLE_ELEMENTS: | |
| 6142 | 6118 | case FAST_HOLEY_DOUBLE_ELEMENTS: { | |
| 6143 | - HStoreKeyed* instr = Add<HStoreKeyed>(elements, key, value, nullptr, | ||
| 6144 | - boilerplate_elements_kind); | ||
| 6145 | - instr->SetUninitialized(uninitialized); | ||
| 6119 | + Add<HStoreKeyed>(elements, key, value, nullptr, | ||
| 6120 | + boilerplate_elements_kind); | ||
| 6146 | 6121 | break; | |
| 6147 | 6122 | } | |
| 6148 | 6123 | default: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -138,7 +138,7 @@ MUST_USE_RESULT static MaybeHandle<Object> CreateObjectLiteralBoilerplate( | |||
| 138 | 138 | } | |
| 139 | 139 | ||
| 140 | 140 | ||
| 141 | - MaybeHandle<Object> Runtime::CreateArrayLiteralBoilerplate( | ||
| 141 | + static MaybeHandle<Object> CreateArrayLiteralBoilerplate( | ||
| 142 | 142 | Isolate* isolate, Handle<LiteralsArray> literals, | |
| 143 | 143 | Handle<FixedArray> elements, bool is_strong) { | |
| 144 | 144 | // Create the JSArray. | |
@@ -225,8 +225,8 @@ MUST_USE_RESULT static MaybeHandle<Object> CreateLiteralBoilerplate( | |||
| 225 | 225 | return CreateObjectLiteralBoilerplate(isolate, literals, elements, false, | |
| 226 | 226 | kHasNoFunctionLiteral, is_strong); | |
| 227 | 227 | case CompileTimeValue::ARRAY_LITERAL: | |
| 228 | - return Runtime::CreateArrayLiteralBoilerplate(isolate, literals, | ||
| 229 | - elements, is_strong); | ||
| 228 | + return CreateArrayLiteralBoilerplate(isolate, literals, | ||
| 229 | + elements, is_strong); | ||
| 230 | 230 | default: | |
| 231 | 231 | UNREACHABLE(); | |
| 232 | 232 | return MaybeHandle<Object>(); | |
@@ -318,8 +318,7 @@ MUST_USE_RESULT static MaybeHandle<AllocationSite> GetLiteralAllocationSite( | |||
| 318 | 318 | Handle<Object> boilerplate; | |
| 319 | 319 | ASSIGN_RETURN_ON_EXCEPTION( | |
| 320 | 320 | isolate, boilerplate, | |
| 321 | - Runtime::CreateArrayLiteralBoilerplate(isolate, literals, elements, | ||
| 322 | - is_strong), | ||
| 321 | + CreateArrayLiteralBoilerplate(isolate, literals, elements, is_strong), | ||
| 323 | 322 | AllocationSite); | |
| 324 | 323 | ||
| 325 | 324 | AllocationSiteCreationContext creation_context(isolate); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1148,11 +1148,6 @@ class Runtime : public AllStatic { | |||
| 1148 | 1148 | ElementsKind* fixed_elements_kind, | |
| 1149 | 1149 | size_t* element_size); | |
| 1150 | 1150 | ||
| 1151 | - // Used in runtime.cc and hydrogen's VisitArrayLiteral. | ||
| 1152 | - MUST_USE_RESULT static MaybeHandle<Object> CreateArrayLiteralBoilerplate( | ||
| 1153 | - Isolate* isolate, Handle<LiteralsArray> literals, | ||
| 1154 | - Handle<FixedArray> elements, bool is_strong); | ||
| 1155 | - | ||
| 1156 | 1151 | static MaybeHandle<JSArray> GetInternalProperties(Isolate* isolate, | |
| 1157 | 1152 | Handle<Object>); | |
| 1158 | 1153 | }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments