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

Introduce 'kLengthString' in torque code

This CL replaces occurrences of "length" with the CSA macro
LengthStringConstant().

R=jgruber@chromium.org

Bug: v8:8015
Change-Id: Idf095587940f859e4c634865560abae325cd9fb4
Reviewed-on: https://chromium-review.googlesource.com/1201782Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#55578}
parent 669bfe46
......@@ -20,7 +20,7 @@ module array {
return a.length_fast;
} else
deferred {
return ToLength_Inline(context, GetProperty(context, o, 'length'));
return ToLength_Inline(context, GetProperty(context, o, kLengthString));
}
}
......
......@@ -149,12 +149,14 @@ extern macro TrueConstant(): Boolean;
extern macro FalseConstant(): Boolean;
extern macro Int32TrueConstant(): bool;
extern macro Int32FalseConstant(): bool;
extern macro LengthStringConstant(): String;
const Hole: Oddball = TheHoleConstant();
const Null: Oddball = NullConstant();
const Undefined: Oddball = UndefinedConstant();
const True: Boolean = TrueConstant();
const False: Boolean = FalseConstant();
const kLengthString: String = LengthStringConstant();
const true: constexpr bool generates 'true';
const false: constexpr bool generates 'false';
......
......@@ -554,7 +554,7 @@ module array {
if (IsJSArray(receiver)) return unsafe_cast<JSArray>(receiver).length_fast;
const len: Number =
ToLength_Inline(context, GetProperty(context, receiver, 'length'));
ToLength_Inline(context, GetProperty(context, receiver, kLengthString));
return unsafe_cast<Smi>(len);
}
......@@ -1782,8 +1782,7 @@ module array {
}
label slow {
// 3. Let len be ? ToLength(? Get(obj, "length")).
const len: Number =
ToLength_Inline(context, GetProperty(context, obj, 'length'));
const len: Number = GetLengthProperty(context, obj);
if (len < 2) return receiver;
const nofNonUndefined: Smi = PrepareElementsForSort(context, obj, len);
......
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