Add boolean runtime checks for different element kinds.
This will be used for Array.p.sort benchmarks to ensure that the arrays will have the correct element kind. R=cbruni@chromium.org, jgruber@chromium.org Bug: v8:7382 Change-Id: I4fe58d97d7f18fd193d4432964cf6b4f5335e0e7 Reviewed-on: https://chromium-review.googlesource.com/1004754 Commit-Queue: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#52511}
This commit is contained in:
parent
0921238162
commit
29308cf0e5
@ -874,6 +874,24 @@ RUNTIME_FUNCTION(Runtime_HasFastPackedElements) {
|
||||
IsFastPackedElementsKind(obj->map()->elements_kind()));
|
||||
}
|
||||
|
||||
#define RUNTIME_FUNCTION_CHECK_ELEMENT_KIND(Name, Kind) \
|
||||
RUNTIME_FUNCTION(Runtime_##Name) { \
|
||||
SealHandleScope shs(isolate); \
|
||||
DCHECK_EQ(1, args.length()); \
|
||||
CONVERT_ARG_CHECKED(HeapObject, obj, 0); \
|
||||
return isolate->heap()->ToBoolean(obj->map()->elements_kind() == Kind); \
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION_CHECK_ELEMENT_KIND(HasPackedSmiElements, PACKED_SMI_ELEMENTS)
|
||||
RUNTIME_FUNCTION_CHECK_ELEMENT_KIND(HasPackedDoubleElements,
|
||||
PACKED_DOUBLE_ELEMENTS)
|
||||
RUNTIME_FUNCTION_CHECK_ELEMENT_KIND(HasPackedObjectElements, PACKED_ELEMENTS)
|
||||
RUNTIME_FUNCTION_CHECK_ELEMENT_KIND(HasHoleySmiElements, HOLEY_SMI_ELEMENTS)
|
||||
RUNTIME_FUNCTION_CHECK_ELEMENT_KIND(HasHoleyDoubleElements,
|
||||
HOLEY_DOUBLE_ELEMENTS)
|
||||
RUNTIME_FUNCTION_CHECK_ELEMENT_KIND(HasHoleyObjectElements, HOLEY_ELEMENTS)
|
||||
|
||||
#undef RUNTIME_FUNCTION_CHECK_ELEMENT_KIND
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_ValueOf) {
|
||||
SealHandleScope shs(isolate);
|
||||
|
@ -382,6 +382,12 @@ namespace internal {
|
||||
F(GetOwnPropertyKeys, 2, 1) \
|
||||
F(GetProperty, 2, 1) \
|
||||
F(GetPrototype, 1, 1) \
|
||||
F(HasPackedSmiElements, 1, 1) \
|
||||
F(HasPackedDoubleElements, 1, 1) \
|
||||
F(HasPackedObjectElements, 1, 1) \
|
||||
F(HasHoleySmiElements, 1, 1) \
|
||||
F(HasHoleyDoubleElements, 1, 1) \
|
||||
F(HasHoleyObjectElements, 1, 1) \
|
||||
F(HasFastPackedElements, 1, 1) \
|
||||
F(HasInPrototypeChain, 2, 1) \
|
||||
F(HasProperty, 2, 1) \
|
||||
|
Loading…
Reference in New Issue
Block a user