Commit 612adf65 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cleanup] Fix uses of things declared in -inl headers by -h headers

Bug: v8:7754,v8:7490,v8:7965
Change-Id: I574dbade6dc21204461be4d83b138f7341016305
Reviewed-on: https://chromium-review.googlesource.com/1152819Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54779}
parent 0ad5dda1
......@@ -10,7 +10,7 @@
#include "src/contexts.h"
#include "src/counters.h"
#include "src/debug/debug.h"
#include "src/elements.h"
#include "src/elements-inl.h"
#include "src/global-handles.h"
#include "src/isolate.h"
#include "src/lookup.h"
......
......@@ -7,8 +7,11 @@
#include "src/elements.h"
#include "src/handles-inl.h"
namespace v8 {
namespace internal {
inline void ElementsAccessor::CollectElementIndices(Handle<JSObject> object,
KeyAccumulator* keys) {
CollectElementIndices(object, handle(object->elements(), keys->isolate()),
......@@ -23,6 +26,11 @@ inline MaybeHandle<FixedArray> ElementsAccessor::PrependElementIndices(
keys, convert, filter);
}
inline bool ElementsAccessor::HasElement(JSObject* holder, uint32_t index,
PropertyFilter filter) {
return HasElement(holder, index, holder->elements(), filter);
}
} // namespace internal
} // namespace v8
......
......@@ -48,9 +48,7 @@ class ElementsAccessor {
PropertyFilter filter = ALL_PROPERTIES) = 0;
inline bool HasElement(JSObject* holder, uint32_t index,
PropertyFilter filter = ALL_PROPERTIES) {
return HasElement(holder, index, holder->elements(), filter);
}
PropertyFilter filter = ALL_PROPERTIES);
// Note: this is currently not implemented for string wrapper and
// typed array elements.
......
......@@ -23,6 +23,12 @@ Handle<T> Handle<T>::New(T* object, Isolate* isolate) {
reinterpret_cast<T**>(HandleScope::CreateHandle(isolate, object)));
}
template <typename T>
template <typename S>
const Handle<T> Handle<T>::cast(Handle<S> that) {
T::cast(*reinterpret_cast<T**>(that.location()));
return Handle<T>(reinterpret_cast<T**>(that.location_));
}
HandleScope::HandleScope(Isolate* isolate) {
HandleScopeData* data = isolate->handle_scope_data();
......
......@@ -123,10 +123,7 @@ class Handle final : public HandleBase {
}
template <typename S>
static const Handle<T> cast(Handle<S> that) {
T::cast(*reinterpret_cast<T**>(that.location()));
return Handle<T>(reinterpret_cast<T**>(that.location_));
}
inline static const Handle<T> cast(Handle<S> that);
// TODO(yangguo): Values that contain empty handles should be declared as
// MaybeHandle to force validation before being used as handles.
......
......@@ -6,6 +6,7 @@
#include "src/api-arguments-inl.h"
#include "src/elements-inl.h"
#include "src/handles-inl.h"
#include "src/heap/factory.h"
#include "src/identity-map.h"
#include "src/isolate-inl.h"
......@@ -60,6 +61,10 @@ Handle<FixedArray> KeyAccumulator::GetKeys(GetKeysConversion convert) {
return result;
}
Handle<OrderedHashSet> KeyAccumulator::keys() {
return Handle<OrderedHashSet>::cast(keys_);
}
void KeyAccumulator::AddKey(Object* key, AddKeyConversion convert) {
AddKey(handle(key, isolate_), convert);
}
......
......@@ -103,7 +103,7 @@ class KeyAccumulator final BASE_EMBEDDED {
Handle<FixedArray> keys);
bool IsShadowed(Handle<Object> key);
bool HasShadowingKeys();
Handle<OrderedHashSet> keys() { return Handle<OrderedHashSet>::cast(keys_); }
Handle<OrderedHashSet> keys();
Isolate* isolate_;
// keys_ is either an Handle<OrderedHashSet> or in the case of own JSProxy
......
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