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

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

Issue 2433333002: [ic] Refactoring definition of a smi-encoded load handlers. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | src/ic/handler-compiler.cc » ('j') | 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 6504c84287b0fb715c795760a180202c2697f1d5..e22d56e53b448811d3a878c83ba1cecf827d1f2a 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -5274,18 +5274,20 @@ void CodeStubAssembler::HandleLoadICHandlerCase(
Node* holder = var_holder.value();
Node* handler_word = SmiUntag(var_smi_handler.value());
- Node* handler_type = DecodeWord<LoadHandlerTypeBits>(handler_word);
+ Node* handler_kind = DecodeWord<LoadHandler::KindBits>(handler_word);
if (support_elements == kSupportElements) {
Label property(this);
GotoUnless(
- WordEqual(handler_type, IntPtrConstant(kLoadICHandlerForElements)),
+ WordEqual(handler_kind, IntPtrConstant(LoadHandler::kForElements)),
&property);
Comment("element_load");
Node* intptr_index = TryToIntptr(p->name, miss);
Node* elements = LoadElements(holder);
- Node* is_jsarray_condition = IsSetWord<KeyedLoadIsJsArray>(handler_word);
- Node* elements_kind = DecodeWord<KeyedLoadElementsKind>(handler_word);
+ Node* is_jsarray_condition =
+ IsSetWord<LoadHandler::IsJsArrayBits>(handler_word);
+ Node* elements_kind =
+ DecodeWord<LoadHandler::ElementsKindBits>(handler_word);
Label if_hole(this), unimplemented_elements_kind(this);
Label* out_of_bounds = miss;
EmitElementLoad(holder, elements, elements_kind, intptr_index,
@@ -5304,7 +5306,7 @@ void CodeStubAssembler::HandleLoadICHandlerCase(
Bind(&if_hole);
{
Comment("convert hole");
- GotoUnless(IsSetWord<KeyedLoadConvertHole>(handler_word), miss);
+ GotoUnless(IsSetWord<LoadHandler::ConvertHoleBits>(handler_word), miss);
Node* protector_cell = LoadRoot(Heap::kArrayProtectorRootIndex);
DCHECK(isolate()->heap()->array_protector()->IsPropertyCell());
GotoUnless(
@@ -5320,22 +5322,22 @@ void CodeStubAssembler::HandleLoadICHandlerCase(
}
Label constant(this), field(this);
- Branch(WordEqual(handler_type, IntPtrConstant(kLoadICHandlerForFields)),
+ Branch(WordEqual(handler_kind, IntPtrConstant(LoadHandler::kForFields)),
&field, &constant);
Bind(&field);
{
Comment("field_load");
- Node* offset = DecodeWord<FieldOffsetOffset>(handler_word);
+ Node* offset = DecodeWord<LoadHandler::FieldOffsetBits>(handler_word);
Label inobject(this), out_of_object(this);
- Branch(IsSetWord<FieldOffsetIsInobject>(handler_word), &inobject,
+ Branch(IsSetWord<LoadHandler::IsInobjectBits>(handler_word), &inobject,
&out_of_object);
Bind(&inobject);
{
Label is_double(this);
- GotoIf(IsSetWord<FieldOffsetIsDouble>(handler_word), &is_double);
+ GotoIf(IsSetWord<LoadHandler::IsDoubleBits>(handler_word), &is_double);
Return(LoadObjectField(holder, offset));
Bind(&is_double);
@@ -5354,7 +5356,7 @@ void CodeStubAssembler::HandleLoadICHandlerCase(
Label is_double(this);
Node* properties = LoadProperties(holder);
Node* value = LoadObjectField(properties, offset);
- GotoIf(IsSetWord<FieldOffsetIsDouble>(handler_word), &is_double);
+ GotoIf(IsSetWord<LoadHandler::IsDoubleBits>(handler_word), &is_double);
Return(value);
Bind(&is_double);
@@ -5370,7 +5372,8 @@ void CodeStubAssembler::HandleLoadICHandlerCase(
{
Comment("constant_load");
Node* descriptors = LoadMapDescriptors(LoadMap(holder));
- Node* descriptor = DecodeWord<ValueIndexInDescriptorArray>(handler_word);
+ Node* descriptor =
+ DecodeWord<LoadHandler::DescriptorValueIndexBits>(handler_word);
#if defined(DEBUG)
CSA_ASSERT(UintPtrLessThan(
descriptor, LoadAndUntagFixedArrayBaseLength(descriptors)));
« no previous file with comments | « no previous file | src/ic/handler-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698