Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: src/crankshaft/hydrogen.cc

Issue 2010503002: Version 5.2.361.7 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.2
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8-version.h ('k') | test/mjsunit/regress/regress-606021.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 9e143353bc56994b5418a43faf1621b0b2f7737e..3e84c839427b75363bfb1681fbaa16421b47e16a 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -6180,11 +6180,6 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
JSObject::cast(site->transition_info()), isolate());
}
- ElementsKind boilerplate_elements_kind = expr->constant_elements_kind();
- if (!boilerplate_object.is_null()) {
- boilerplate_elements_kind = boilerplate_object->GetElementsKind();
- }
-
// Check whether to use fast or slow deep-copying for boilerplate.
int max_properties = kMaxFastLiteralProperties;
if (!boilerplate_object.is_null() &&
@@ -6235,20 +6230,28 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
HValue* key = Add<HConstant>(i);
- switch (boilerplate_elements_kind) {
- case FAST_SMI_ELEMENTS:
- case FAST_HOLEY_SMI_ELEMENTS:
- case FAST_ELEMENTS:
- case FAST_HOLEY_ELEMENTS:
- case FAST_DOUBLE_ELEMENTS:
- case FAST_HOLEY_DOUBLE_ELEMENTS: {
- Add<HStoreKeyed>(elements, key, value, nullptr,
- boilerplate_elements_kind);
- break;
+ if (!boilerplate_object.is_null()) {
+ ElementsKind boilerplate_elements_kind =
+ boilerplate_object->GetElementsKind();
+ switch (boilerplate_elements_kind) {
+ case FAST_SMI_ELEMENTS:
+ case FAST_HOLEY_SMI_ELEMENTS:
+ case FAST_ELEMENTS:
+ case FAST_HOLEY_ELEMENTS:
+ case FAST_DOUBLE_ELEMENTS:
+ case FAST_HOLEY_DOUBLE_ELEMENTS: {
+ Add<HStoreKeyed>(elements, key, value, nullptr,
+ boilerplate_elements_kind);
+ break;
+ }
+ default:
+ UNREACHABLE();
+ break;
}
- default:
- UNREACHABLE();
- break;
+ } else {
+ HInstruction* instr = BuildKeyedGeneric(
+ STORE, expr, expr->LiteralFeedbackSlot(), literal, key, value);
+ AddInstruction(instr);
}
Add<HSimulate>(expr->GetIdForElement(i));
« no previous file with comments | « include/v8-version.h ('k') | test/mjsunit/regress/regress-606021.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698