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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 2631123002: [crankshaft][runtime] Initialize uninitialized double fields with hole NaN value instead of 0.0. (Closed)
Patch Set: Created 3 years, 11 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 | « src/crankshaft/hydrogen.h ('k') | src/factory.h » ('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 959e409500ab66ffe93613f83f68c7d16e3162ec..81b651d32c608c7cbc1a16354fadf57f9efe095c 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -5500,6 +5500,7 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
if (info.CanAccessMonomorphic()) {
HValue* checked_literal = Add<HCheckMaps>(literal, map);
DCHECK(!info.IsAccessorConstant());
+ info.MarkAsInitializingStore();
store = BuildMonomorphicAccess(
&info, literal, checked_literal, value,
BailoutId::None(), BailoutId::None());
@@ -5741,9 +5742,8 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
}
// This is a normal store.
- instr = New<HStoreNamedField>(
- checked_object->ActualValue(), field_access, value,
- transition_to_field ? INITIALIZING_STORE : STORE_TO_INITIALIZED_ENTRY);
+ instr = New<HStoreNamedField>(checked_object->ActualValue(), field_access,
+ value, info->StoreMode());
}
if (transition_to_field) {
@@ -5754,6 +5754,17 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
return instr;
}
+void HOptimizedGraphBuilder::PropertyAccessInfo::MarkAsInitializingStore() {
+ DCHECK_EQ(STORE, access_type_);
+ store_mode_ = INITIALIZING_STORE;
+}
+
+StoreFieldOrKeyedMode HOptimizedGraphBuilder::PropertyAccessInfo::StoreMode() {
+ DCHECK_EQ(STORE, access_type_);
+ if (IsTransition()) return INITIALIZING_STORE;
Toon Verwaest 2017/01/16 11:53:31 if IsTransition() is true, store_mode_ should just
Igor Sheludko 2017/01/16 12:02:59 Done.
+ return store_mode_;
+}
+
Handle<FieldType>
HOptimizedGraphBuilder::PropertyAccessInfo::GetFieldTypeFromMap(
Handle<Map> map) const {
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698