Commit e66824eb authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[cleanup] Re-order parameters for HasProperty

This CL changes the order of the parameters of HasProperty to be
more consistent with other CSA macros.

Drive-by-change: Use HasProperty stub directly in Torque.

R=jgruber@chromium.org

Bug: v8:8015
Change-Id: I73d1096afbb86d52e2af67c1969549f1158448a7
Reviewed-on: https://chromium-review.googlesource.com/1166831
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55025}
parent 46507be7
......@@ -13,7 +13,7 @@ module array {
let pK: String = ToString_Inline(context, k);
// 6b. Let kPresent be ? HasProperty(O, Pk).
let kPresent: Oddball = TorqueHasProperty(context, o, pK);
let kPresent: Oddball = HasProperty(context, o, pK);
// 6c. If kPresent is true, then
if (kPresent == True) {
......
......@@ -178,7 +178,7 @@ module array {
let from: String = ToString_Inline(context, actualStart + k);
// b. Let fromPresent be ? HasProperty(O, from).
let fromPresent: Oddball = TorqueHasProperty(context, o, from);
let fromPresent: Oddball = HasProperty(context, o, from);
// c. If fromPresent is true, then
if (fromPresent == True) {
......@@ -216,7 +216,7 @@ module array {
let to: String = ToString_Inline(context, k + itemCount);
// iii. Let fromPresent be ? HasProperty(O, from).
let fromPresent: Oddball = TorqueHasProperty(context, o, from);
let fromPresent: Oddball = HasProperty(context, o, from);
// iv. If fromPresent is true, then
if (fromPresent == True) {
......@@ -259,7 +259,7 @@ module array {
let to: String = ToString_Inline(context, k + itemCount - 1);
// iii. Let fromPresent be ? HasProperty(O, from).
let fromPresent: Oddball = TorqueHasProperty(context, o, from);
let fromPresent: Oddball = HasProperty(context, o, from);
// iv. If fromPresent is true, then
if (fromPresent == True) {
......
......@@ -181,12 +181,7 @@ extern macro ToLength_Inline(Context, Object): Number;
extern macro ToNumber_Inline(Context, Object): Number;
extern macro ToString_Inline(Context, Object): String;
extern macro GetProperty(Context, Object, Object): Object;
extern builtin HasProperty(Context, JSReceiver, Object): Boolean;
macro TorqueHasProperty(
context: Context, receiver: JSReceiver, key: Object): Boolean {
return HasProperty(context, receiver, key);
}
extern macro ThrowRangeError(Context, constexpr MessageTemplate): never;
extern macro ThrowTypeError(Context, constexpr MessageTemplate): never;
......
......@@ -629,7 +629,7 @@ Node* ArrayBuiltinsAssembler::FindProcessor(Node* k_value, Node* k) {
// b. Let kPresent be HasProperty(O, Pk).
// c. ReturnIfAbrupt(kPresent).
TNode<Oddball> k_present =
HasProperty(o(), k(), context(), kHasProperty);
HasProperty(context(), o(), k(), kHasProperty);
// d. If kPresent is true, then
GotoIf(IsFalse(k_present), &done_element);
......@@ -1311,7 +1311,7 @@ class ArrayPrototypeSliceCodeStubAssembler : public CodeStubAssembler {
Variable& n) {
// b. Let kPresent be HasProperty(O, Pk).
// c. ReturnIfAbrupt(kPresent).
TNode<Oddball> k_present = HasProperty(o, p_k, context, kHasProperty);
TNode<Oddball> k_present = HasProperty(context, o, p_k, kHasProperty);
// d. If kPresent is true, then
Label done_element(this);
......@@ -3840,7 +3840,7 @@ class ArrayFlattenAssembler : public CodeStubAssembler {
CSA_ASSERT(this,
SmiGreaterThanOrEqual(CAST(source_index), SmiConstant(0)));
Node* const exists =
HasProperty(source, source_index, context, kHasProperty);
HasProperty(context, source, source_index, kHasProperty);
// c. If exists is true, then
Label next(this);
......
......@@ -580,7 +580,7 @@ TF_BUILTIN(ForInFilter, CodeStubAssembler) {
CSA_ASSERT(this, IsString(key));
Label if_true(this), if_false(this);
TNode<Oddball> result = HasProperty(object, key, context, kForInHasProperty);
TNode<Oddball> result = HasProperty(context, object, key, kForInHasProperty);
Branch(IsTrue(result), &if_true, &if_false);
BIND(&if_true);
......
......@@ -1423,7 +1423,7 @@ TF_BUILTIN(HasProperty, ObjectBuiltinsAssembler) {
Node* object = Parameter(Descriptor::kObject);
Node* context = Parameter(Descriptor::kContext);
Return(HasProperty(object, key, context, kHasProperty));
Return(HasProperty(context, object, key, kHasProperty));
}
TF_BUILTIN(InstanceOf, ObjectBuiltinsAssembler) {
......
......@@ -11238,9 +11238,9 @@ void CodeStubAssembler::BranchIfSameValue(Node* lhs, Node* rhs, Label* if_true,
}
}
TNode<Oddball> CodeStubAssembler::HasProperty(SloppyTNode<HeapObject> object,
TNode<Oddball> CodeStubAssembler::HasProperty(SloppyTNode<Context> context,
SloppyTNode<Object> object,
SloppyTNode<Object> 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);
......
......@@ -2628,9 +2628,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
enum HasPropertyLookupMode { kHasProperty, kForInHasProperty };
TNode<Oddball> HasProperty(SloppyTNode<HeapObject> object,
TNode<Oddball> HasProperty(SloppyTNode<Context> context,
SloppyTNode<Object> object,
SloppyTNode<Object> key,
SloppyTNode<Context> context,
HasPropertyLookupMode mode);
Node* Typeof(Node* value);
......
......@@ -1815,7 +1815,7 @@ IGNITION_HANDLER(TestIn, InterpreterAssembler) {
Node* object = GetAccumulator();
Node* context = GetContext();
SetAccumulator(HasProperty(object, property, context, kHasProperty));
SetAccumulator(HasProperty(context, object, property, kHasProperty));
Dispatch();
}
......
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