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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1614943002: [crankshaft] Remove the useless HMapEnumLength instruction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Put NoObservableSideEffectsScope there Created 4 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/crankshaft/hydrogen-instructions.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 53032073be238ff30dfbd879f5ae3603aed71faa..0fa2df566d556ec94ca0a49e1b13b5dc1b0cc4be 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -1275,6 +1275,14 @@ HValue* HGraphBuilder::BuildGetElementsKind(HValue* object) {
}
+HValue* HGraphBuilder::BuildEnumLength(HValue* map) {
+ NoObservableSideEffectsScope scope(this);
+ HValue* bit_field3 =
+ Add<HLoadNamedField>(map, nullptr, HObjectAccess::ForMapBitField3());
+ return BuildDecodeField<Map::EnumLengthBits>(bit_field3);
+}
+
+
HValue* HGraphBuilder::BuildCheckHeapObject(HValue* obj) {
if (obj->type().IsHeapObject()) return obj;
return Add<HCheckHeapObject>(obj);
@@ -5328,7 +5336,7 @@ void HOptimizedGraphBuilder::BuildForInBody(ForInStatement* stmt,
array = Add<HForInCacheArray>(enumerable, map,
DescriptorArray::kEnumCacheBridgeCacheIndex);
- enum_length = Add<HMapEnumLength>(map);
+ enum_length = BuildEnumLength(map);
HInstruction* index_cache = Add<HForInCacheArray>(
enumerable, map, DescriptorArray::kEnumCacheBridgeIndicesCacheIndex);
@@ -5350,7 +5358,7 @@ void HOptimizedGraphBuilder::BuildForInBody(ForInStatement* stmt,
HValue* cache_map = array;
HForInCacheArray* cache = Add<HForInCacheArray>(
enumerable, cache_map, DescriptorArray::kEnumCacheBridgeCacheIndex);
- enum_length = Add<HMapEnumLength>(cache_map);
+ enum_length = BuildEnumLength(cache_map);
Push(cache_map);
Push(cache);
Push(enum_length);
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/crankshaft/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698