Commit 33c5e802 authored by peterwmwong's avatar peterwmwong Committed by Commit Bot

[CSA] Add types to CSA HasProperty

Bug: 
Change-Id: If86c51b428f254ffce68d295f9e8001cee27b9ce
Reviewed-on: https://chromium-review.googlesource.com/833236Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#50219}
parent bce199bb
......@@ -580,10 +580,11 @@ class ArrayBuiltinCodeStubAssembler : public CodeStubAssembler {
if (missing_property_mode == MissingPropertyMode::kSkip) {
// b. Let kPresent be HasProperty(O, Pk).
// c. ReturnIfAbrupt(kPresent).
Node* k_present = HasProperty(o(), k(), context(), kHasProperty);
TNode<Oddball> k_present =
HasProperty(o(), k(), context(), kHasProperty);
// d. If kPresent is true, then
GotoIf(WordNotEqual(k_present, TrueConstant()), &done_element);
GotoIf(IsFalse(k_present), &done_element);
}
// i. Let kValue be Get(O, Pk).
......@@ -1263,11 +1264,11 @@ class FastArraySliceCodeStubAssembler : public CodeStubAssembler {
void CopyOneElement(Node* context, Node* o, Node* a, Node* p_k, Variable& n) {
// b. Let kPresent be HasProperty(O, Pk).
// c. ReturnIfAbrupt(kPresent).
Node* k_present = HasProperty(o, p_k, context, kHasProperty);
TNode<Oddball> k_present = HasProperty(o, p_k, context, kHasProperty);
// d. If kPresent is true, then
Label done_element(this);
GotoIf(WordNotEqual(k_present, TrueConstant()), &done_element);
GotoIf(IsFalse(k_present), &done_element);
// i. Let kValue be Get(O, Pk).
// ii. ReturnIfAbrupt(kValue).
......
......@@ -587,7 +587,7 @@ TF_BUILTIN(ForInFilter, CodeStubAssembler) {
CSA_ASSERT(this, IsString(key));
Label if_true(this), if_false(this);
Node* result = HasProperty(object, key, context, kForInHasProperty);
TNode<Oddball> result = HasProperty(object, key, context, kForInHasProperty);
Branch(IsTrue(result), &if_true, &if_false);
BIND(&if_true);
......
......@@ -9491,7 +9491,9 @@ void CodeStubAssembler::BranchIfSameValue(Node* lhs, Node* rhs, Label* if_true,
}
}
Node* CodeStubAssembler::HasProperty(Node* object, Node* key, Node* context,
TNode<Oddball> CodeStubAssembler::HasProperty(SloppyTNode<HeapObject> object,
SloppyTNode<Name> key,
SloppyTNode<Context> context,
HasPropertyLookupMode mode) {
Label call_runtime(this, Label::kDeferred), return_true(this),
return_false(this), end(this), if_proxy(this, Label::kDeferred);
......@@ -9517,16 +9519,16 @@ Node* CodeStubAssembler::HasProperty(Node* object, Node* key, Node* context,
lookup_element_in_holder, &return_false,
&call_runtime, &if_proxy);
VARIABLE(result, MachineRepresentation::kTagged);
TVARIABLE(Oddball, result);
BIND(&if_proxy);
{
Node* name = ToName(context, key);
TNode<Name> name = CAST(ToName(context, key));
switch (mode) {
case kHasProperty:
GotoIf(IsPrivateSymbol(name), &return_false);
result.Bind(
result = CAST(
CallBuiltin(Builtins::kProxyHasProperty, context, object, name));
Goto(&end);
break;
......@@ -9538,13 +9540,13 @@ Node* CodeStubAssembler::HasProperty(Node* object, Node* key, Node* context,
BIND(&return_true);
{
result.Bind(TrueConstant());
result = TrueConstant();
Goto(&end);
}
BIND(&return_false);
{
result.Bind(FalseConstant());
result = FalseConstant();
Goto(&end);
}
......@@ -9560,13 +9562,14 @@ Node* CodeStubAssembler::HasProperty(Node* object, Node* key, Node* context,
break;
}
result.Bind(
CallRuntime(fallback_runtime_function_id, context, object, key));
result =
CAST(CallRuntime(fallback_runtime_function_id, context, object, key));
Goto(&end);
}
BIND(&end);
return result.value();
CSA_ASSERT(this, IsBoolean(result));
return result;
}
Node* CodeStubAssembler::ClassOf(Node* value) {
......
......@@ -1796,7 +1796,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
enum HasPropertyLookupMode { kHasProperty, kForInHasProperty };
Node* HasProperty(Node* object, Node* key, Node* context,
TNode<Oddball> HasProperty(SloppyTNode<HeapObject> object,
SloppyTNode<Name> key,
SloppyTNode<Context> context,
HasPropertyLookupMode mode);
Node* ClassOf(Node* object);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment