Commit 23e021a8 authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

[turbofan] Brokerize JSCreateLowering::JSCreate*Context

Bug: v8:7790
Change-Id: I053eac9c9b49c65a2f751b1b107e32f7603e63a9
Reviewed-on: https://chromium-review.googlesource.com/1126113Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54234}
parent ac51bfb5
...@@ -1249,10 +1249,11 @@ Reduction JSCreateLowering::ReduceJSCreateLiteralRegExp(Node* node) { ...@@ -1249,10 +1249,11 @@ Reduction JSCreateLowering::ReduceJSCreateLiteralRegExp(Node* node) {
} }
Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) { Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) {
DisallowHandleDereference disallow_dereference;
DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, node->opcode()); DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, node->opcode());
const CreateFunctionContextParameters& parameters = const CreateFunctionContextParameters& parameters =
CreateFunctionContextParametersOf(node->op()); CreateFunctionContextParametersOf(node->op());
Handle<ScopeInfo> scope_info = parameters.scope_info(); ScopeInfoRef scope_info(parameters.scope_info());
int slot_count = parameters.slot_count(); int slot_count = parameters.slot_count();
ScopeType scope_type = parameters.scope_type(); ScopeType scope_type = parameters.scope_type();
...@@ -1296,8 +1297,9 @@ Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) { ...@@ -1296,8 +1297,9 @@ Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) {
} }
Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) { Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) {
DisallowHandleDereference disallow_dereference;
DCHECK_EQ(IrOpcode::kJSCreateWithContext, node->opcode()); DCHECK_EQ(IrOpcode::kJSCreateWithContext, node->opcode());
Handle<ScopeInfo> scope_info = ScopeInfoOf(node->op()); ScopeInfoRef scope_info(ScopeInfoOf(node->op()));
Node* extension = NodeProperties::GetValueInput(node, 0); Node* extension = NodeProperties::GetValueInput(node, 0);
Node* effect = NodeProperties::GetEffectInput(node); Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node); Node* control = NodeProperties::GetControlInput(node);
...@@ -1317,8 +1319,9 @@ Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) { ...@@ -1317,8 +1319,9 @@ Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) {
} }
Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) { Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) {
DisallowHandleDereference disallow_dereference;
DCHECK_EQ(IrOpcode::kJSCreateCatchContext, node->opcode()); DCHECK_EQ(IrOpcode::kJSCreateCatchContext, node->opcode());
Handle<ScopeInfo> scope_info = ScopeInfoOf(node->op()); ScopeInfoRef scope_info(ScopeInfoOf(node->op()));
Node* exception = NodeProperties::GetValueInput(node, 0); Node* exception = NodeProperties::GetValueInput(node, 0);
Node* effect = NodeProperties::GetEffectInput(node); Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node); Node* control = NodeProperties::GetControlInput(node);
...@@ -1342,9 +1345,10 @@ Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) { ...@@ -1342,9 +1345,10 @@ Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) {
} }
Reduction JSCreateLowering::ReduceJSCreateBlockContext(Node* node) { Reduction JSCreateLowering::ReduceJSCreateBlockContext(Node* node) {
DisallowHandleDereference disallow_dereference;
DCHECK_EQ(IrOpcode::kJSCreateBlockContext, node->opcode()); DCHECK_EQ(IrOpcode::kJSCreateBlockContext, node->opcode());
Handle<ScopeInfo> scope_info = ScopeInfoOf(node->op()); ScopeInfoRef scope_info(ScopeInfoOf(node->op()));
int const context_length = scope_info->ContextLength(); int const context_length = scope_info.ContextLength();
// Use inline allocation for block contexts up to a size limit. // Use inline allocation for block contexts up to a size limit.
if (context_length < kBlockContextAllocationLimit) { if (context_length < kBlockContextAllocationLimit) {
......
...@@ -451,6 +451,11 @@ double FixedDoubleArrayRef::get_scalar(int i) const { ...@@ -451,6 +451,11 @@ double FixedDoubleArrayRef::get_scalar(int i) const {
return object<FixedDoubleArray>()->get_scalar(i); return object<FixedDoubleArray>()->get_scalar(i);
} }
int ScopeInfoRef::ContextLength() const {
AllowHandleDereference allow_handle_dereference;
return object<ScopeInfo>()->ContextLength();
}
int SharedFunctionInfoRef::internal_formal_parameter_count() const { int SharedFunctionInfoRef::internal_formal_parameter_count() const {
AllowHandleDereference allow_handle_dereference; AllowHandleDereference allow_handle_dereference;
return object<SharedFunctionInfo>()->internal_formal_parameter_count(); return object<SharedFunctionInfo>()->internal_formal_parameter_count();
......
...@@ -68,6 +68,7 @@ class HeapObjectType { ...@@ -68,6 +68,7 @@ class HeapObjectType {
V(MutableHeapNumber) \ V(MutableHeapNumber) \
V(Name) \ V(Name) \
V(NativeContext) \ V(NativeContext) \
V(ScopeInfo) \
V(ScriptContextTable) \ V(ScriptContextTable) \
V(SharedFunctionInfo) \ V(SharedFunctionInfo) \
V(Map) V(Map)
...@@ -289,6 +290,13 @@ class JSArrayRef : public JSObjectRef { ...@@ -289,6 +290,13 @@ class JSArrayRef : public JSObjectRef {
ObjectRef length(const JSHeapBroker* broker) const; ObjectRef length(const JSHeapBroker* broker) const;
}; };
class ScopeInfoRef : public HeapObjectRef {
public:
explicit ScopeInfoRef(Handle<Object> object) : HeapObjectRef(object) {}
int ContextLength() const;
};
class SharedFunctionInfoRef : public HeapObjectRef { class SharedFunctionInfoRef : public HeapObjectRef {
public: public:
explicit SharedFunctionInfoRef(Handle<Object> object) explicit SharedFunctionInfoRef(Handle<Object> object)
......
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