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

Unified Diff: src/code-stub-assembler.cc

Issue 2380563005: [code-stubs] Add LoadMapElementsKind helper (Closed)
Patch Set: comitting all files Created 4 years, 3 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/code-stub-assembler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 0c698b92009845de76678295a43d7ec05a8c3333..56e429b652beea713eb5fd565c5b8bbf906b06dd 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -967,6 +967,11 @@ Node* CodeStubAssembler::LoadMapInstanceType(Node* map) {
return LoadObjectField(map, Map::kInstanceTypeOffset, MachineType::Uint8());
}
+Node* CodeStubAssembler::LoadMapElementsKind(Node* map) {
+ Node* bit_field2 = LoadMapBitField2(map);
+ return BitFieldDecode<Map::ElementsKindBits>(bit_field2);
+}
+
Node* CodeStubAssembler::LoadMapDescriptors(Node* map) {
return LoadObjectField(map, Map::kDescriptorsOffset);
}
@@ -3708,8 +3713,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map,
Int32Constant(LAST_SPECIAL_RECEIVER_TYPE)),
if_bailout);
- Node* bit_field2 = LoadMapBitField2(map);
- Node* elements_kind = BitFieldDecode<Map::ElementsKindBits>(bit_field2);
+ Node* elements_kind = LoadMapElementsKind(map);
// TODO(verwaest): Support other elements kinds as well.
Label if_isobjectorsmi(this), if_isdouble(this), if_isdictionary(this),
@@ -4819,8 +4823,7 @@ void CodeStubAssembler::KeyedLoadICGeneric(const LoadICParameters* p) {
Comment("integer index");
Node* index = var_index.value();
Node* elements = LoadElements(receiver);
- Node* bitfield2 = LoadMapBitField2(receiver_map);
- Node* elements_kind = BitFieldDecode<Map::ElementsKindBits>(bitfield2);
+ Node* elements_kind = LoadMapElementsKind(receiver_map);
Node* is_jsarray_condition =
Word32Equal(instance_type, Int32Constant(JS_ARRAY_TYPE));
Variable var_double_value(this, MachineRepresentation::kFloat64);
« no previous file with comments | « src/code-stub-assembler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698