Commit e3f47eda authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

[turbofan] Brokerize typed lowering.

Bug: v8:7790
Change-Id: I16a2fa9c37a8b00a067f8f7fd3a87cb747233132
Reviewed-on: https://chromium-review.googlesource.com/1128968
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54416}
parent ed0d279e
......@@ -7,6 +7,7 @@
#include "src/compiler/compilation-dependencies.h"
#include "src/objects-inl.h"
#include "src/objects/js-regexp-inl.h"
#include "src/objects/module-inl.h"
namespace v8 {
namespace internal {
......@@ -129,6 +130,16 @@ base::Optional<MapRef> HeapObjectRef::TryGetObjectCreateMap(
}
}
bool HeapObjectRef::IsSeqString() const {
AllowHandleDereference allow_handle_dereference;
return object<HeapObject>()->IsSeqString();
}
bool HeapObjectRef::IsExternalString() const {
AllowHandleDereference allow_handle_dereference;
return object<HeapObject>()->IsExternalString();
}
bool JSFunctionRef::HasBuiltinFunctionId() const {
AllowHandleDereference allow_handle_dereference;
return object<JSFunction>()->shared()->HasBuiltinFunctionId();
......@@ -178,6 +189,20 @@ MapRef JSFunctionRef::initial_map(const JSHeapBroker* broker) const {
return MapRef(handle(object<JSFunction>()->initial_map(), broker->isolate()));
}
SharedFunctionInfoRef JSFunctionRef::shared(const JSHeapBroker* broker) const {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
return SharedFunctionInfoRef(
handle(object<JSFunction>()->shared(), broker->isolate()));
}
JSGlobalProxyRef JSFunctionRef::global_proxy(const JSHeapBroker* broker) const {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
return JSGlobalProxyRef(
handle(object<JSFunction>()->global_proxy(), broker->isolate()));
}
base::Optional<ScriptContextTableRef::LookupResult>
ScriptContextTableRef::lookup(const NameRef& name) const {
AllowHandleAllocation handle_allocation;
......@@ -550,6 +575,41 @@ bool SharedFunctionInfoRef::has_duplicate_parameters() const {
return object<SharedFunctionInfo>()->has_duplicate_parameters();
}
FunctionKind SharedFunctionInfoRef::kind() const {
AllowHandleDereference allow_handle_dereference;
return object<SharedFunctionInfo>()->kind();
}
LanguageMode SharedFunctionInfoRef::language_mode() {
AllowHandleDereference allow_handle_dereference;
return object<SharedFunctionInfo>()->language_mode();
}
bool SharedFunctionInfoRef::native() const {
AllowHandleDereference allow_handle_dereference;
return object<SharedFunctionInfo>()->native();
}
bool SharedFunctionInfoRef::HasBreakInfo() const {
AllowHandleDereference allow_handle_dereference;
return object<SharedFunctionInfo>()->HasBreakInfo();
}
bool SharedFunctionInfoRef::HasBuiltinId() const {
AllowHandleDereference allow_handle_dereference;
return object<SharedFunctionInfo>()->HasBuiltinId();
}
int SharedFunctionInfoRef::builtin_id() const {
AllowHandleDereference allow_handle_dereference;
return object<SharedFunctionInfo>()->builtin_id();
}
bool SharedFunctionInfoRef::construct_as_builtin() const {
AllowHandleDereference allow_handle_dereference;
return object<SharedFunctionInfo>()->construct_as_builtin();
}
MapRef NativeContextRef::fast_aliased_arguments_map(
const JSHeapBroker* broker) const {
AllowHandleAllocation handle_allocation;
......@@ -643,6 +703,14 @@ bool ObjectRef::BooleanValue(const JSHeapBroker* broker) {
return object<Object>()->BooleanValue(broker->isolate());
}
CellRef ModuleRef::GetCell(const JSHeapBroker* broker, int cell_index) {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;
return CellRef(
handle(object<Module>()->GetCell(cell_index), broker->isolate()));
}
} // namespace compiler
} // namespace internal
} // namespace v8
......@@ -61,6 +61,8 @@ class HeapObjectType {
#define HEAP_BROKER_OBJECT_LIST(V) \
V(AllocationSite) \
V(Cell) \
V(Code) \
V(Context) \
V(FeedbackVector) \
V(FixedArray) \
......@@ -71,9 +73,11 @@ class HeapObjectType {
V(InternalizedString) \
V(JSArray) \
V(JSFunction) \
V(JSGlobalProxy) \
V(JSObject) \
V(JSRegExp) \
V(Map) \
V(Module) \
V(MutableHeapNumber) \
V(Name) \
V(NativeContext) \
......@@ -128,6 +132,8 @@ class HeapObjectRef : public ObjectRef {
MapRef map(const JSHeapBroker* broker) const;
base::Optional<MapRef> TryGetObjectCreateMap(
const JSHeapBroker* broker) const;
bool IsSeqString() const;
bool IsExternalString() const;
};
class JSObjectRef : public HeapObjectRef {
......@@ -156,6 +162,8 @@ class JSFunctionRef : public JSObjectRef {
MapRef DependOnInitialMap(const JSHeapBroker* broker,
CompilationDependencies* dependencies) const;
int GetInstanceSizeWithFinishedSlackTracking() const;
SharedFunctionInfoRef shared(const JSHeapBroker* broker) const;
JSGlobalProxyRef global_proxy(const JSHeapBroker* broker) const;
};
class JSRegExpRef : public JSObjectRef {
......@@ -317,6 +325,13 @@ class SharedFunctionInfoRef : public HeapObjectRef {
int internal_formal_parameter_count() const;
bool has_duplicate_parameters() const;
int function_map_index() const;
FunctionKind kind() const;
LanguageMode language_mode();
bool native() const;
bool HasBreakInfo() const;
bool HasBuiltinId() const;
int builtin_id() const;
bool construct_as_builtin() const;
};
class StringRef : public NameRef {
......@@ -327,6 +342,28 @@ class StringRef : public NameRef {
uint16_t GetFirstChar();
};
class ModuleRef : public HeapObjectRef {
public:
explicit ModuleRef(Handle<Object> object) : HeapObjectRef(object) {}
CellRef GetCell(const JSHeapBroker* broker, int cell_index);
};
class CellRef : public HeapObjectRef {
public:
explicit CellRef(Handle<Object> object) : HeapObjectRef(object) {}
};
class JSGlobalProxyRef : public JSObjectRef {
public:
explicit JSGlobalProxyRef(Handle<Object> object) : JSObjectRef(object) {}
};
class CodeRef : public HeapObjectRef {
public:
explicit CodeRef(Handle<Object> object) : HeapObjectRef(object) {}
};
class InternalizedStringRef : public StringRef {
public:
using StringRef::StringRef;
......
This diff is collapsed.
......@@ -98,12 +98,14 @@ class V8_EXPORT_PRIVATE JSTypedLowering final
Factory* factory() const;
Graph* graph() const;
JSGraph* jsgraph() const { return jsgraph_; }
const JSHeapBroker* js_heap_broker() const { return js_heap_broker_; }
Isolate* isolate() const;
JSOperatorBuilder* javascript() const;
CommonOperatorBuilder* common() const;
SimplifiedOperatorBuilder* simplified() const;
JSGraph* jsgraph_;
const JSHeapBroker* js_heap_broker_;
Type empty_string_type_;
Type pointer_comparable_type_;
TypeCache const& type_cache_;
......
......@@ -192,6 +192,8 @@ struct HeapObjectMatcher final
bool Is(Handle<HeapObject> const& value) const {
return this->HasValue() && this->Value().address() == value.address();
}
ObjectRef Ref() const { return ObjectRef(this->Value()); }
};
......
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