Commit e7d8e978 authored by Jakob Gruber's avatar Jakob Gruber Committed by V8 LUCI CQ

[compiler] Change all JS operators to hold TinyRefs instead of handles

Bug: v8:7790
Change-Id: Ia5903364a774bd49db1a646b3066b9972deac725
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3074465
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76119}
parent b460a69d
...@@ -1676,8 +1676,7 @@ Node* BytecodeGraphBuilder::BuildLoadGlobal(NameRef name, ...@@ -1676,8 +1676,7 @@ Node* BytecodeGraphBuilder::BuildLoadGlobal(NameRef name,
TypeofMode typeof_mode) { TypeofMode typeof_mode) {
FeedbackSource feedback = CreateFeedbackSource(feedback_slot_index); FeedbackSource feedback = CreateFeedbackSource(feedback_slot_index);
DCHECK(IsLoadGlobalICKind(broker()->GetFeedbackSlotKind(feedback))); DCHECK(IsLoadGlobalICKind(broker()->GetFeedbackSlotKind(feedback)));
const Operator* op = const Operator* op = javascript()->LoadGlobal(name, feedback, typeof_mode);
javascript()->LoadGlobal(name.object(), feedback, typeof_mode);
DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode())); DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode()));
return NewNode(op, feedback_vector_node()); return NewNode(op, feedback_vector_node());
} }
...@@ -1708,8 +1707,7 @@ void BytecodeGraphBuilder::VisitStaGlobal() { ...@@ -1708,8 +1707,7 @@ void BytecodeGraphBuilder::VisitStaGlobal() {
LanguageMode language_mode = LanguageMode language_mode =
GetLanguageModeFromSlotKind(broker()->GetFeedbackSlotKind(feedback)); GetLanguageModeFromSlotKind(broker()->GetFeedbackSlotKind(feedback));
const Operator* op = const Operator* op = javascript()->StoreGlobal(language_mode, name, feedback);
javascript()->StoreGlobal(language_mode, name.object(), feedback);
DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode())); DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode()));
Node* node = NewNode(op, value, feedback_vector_node()); Node* node = NewNode(op, value, feedback_vector_node());
environment()->RecordAfterState(node, Environment::kAttachFrameState); environment()->RecordAfterState(node, Environment::kAttachFrameState);
...@@ -1892,13 +1890,12 @@ base::Optional<ScopeInfoRef> BytecodeGraphBuilder::TryGetScopeInfo() { ...@@ -1892,13 +1890,12 @@ base::Optional<ScopeInfoRef> BytecodeGraphBuilder::TryGetScopeInfo() {
Node* context = environment()->Context(); Node* context = environment()->Context();
switch (context->opcode()) { switch (context->opcode()) {
case IrOpcode::kJSCreateFunctionContext: case IrOpcode::kJSCreateFunctionContext:
return MakeRef( return CreateFunctionContextParametersOf(context->op())
broker(), .scope_info(broker());
CreateFunctionContextParametersOf(context->op()).scope_info());
case IrOpcode::kJSCreateBlockContext: case IrOpcode::kJSCreateBlockContext:
case IrOpcode::kJSCreateCatchContext: case IrOpcode::kJSCreateCatchContext:
case IrOpcode::kJSCreateWithContext: case IrOpcode::kJSCreateWithContext:
return MakeRef(broker(), ScopeInfoOf(context->op())); return ScopeInfoOf(broker(), context->op());
case IrOpcode::kParameter: { case IrOpcode::kParameter: {
ScopeInfoRef scope_info = shared_info_.scope_info(); ScopeInfoRef scope_info = shared_info_.scope_info();
if (scope_info.HasOuterScopeInfo()) { if (scope_info.HasOuterScopeInfo()) {
...@@ -2101,7 +2098,7 @@ void BytecodeGraphBuilder::VisitLdaNamedProperty() { ...@@ -2101,7 +2098,7 @@ void BytecodeGraphBuilder::VisitLdaNamedProperty() {
NameRef name = MakeRefForConstantForIndexOperand<Name>(1); NameRef name = MakeRefForConstantForIndexOperand<Name>(1);
FeedbackSource feedback = FeedbackSource feedback =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(2)); CreateFeedbackSource(bytecode_iterator().GetIndexOperand(2));
const Operator* op = javascript()->LoadNamed(name.object(), feedback); const Operator* op = javascript()->LoadNamed(name, feedback);
JSTypeHintLowering::LoweringResult lowering = JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedLoadNamed(op, feedback.slot); TryBuildSimplifiedLoadNamed(op, feedback.slot);
...@@ -2127,8 +2124,7 @@ void BytecodeGraphBuilder::VisitLdaNamedPropertyFromSuper() { ...@@ -2127,8 +2124,7 @@ void BytecodeGraphBuilder::VisitLdaNamedPropertyFromSuper() {
FeedbackSource feedback = FeedbackSource feedback =
CreateFeedbackSource(bytecode_iterator().GetIndexOperand(2)); CreateFeedbackSource(bytecode_iterator().GetIndexOperand(2));
const Operator* op = const Operator* op = javascript()->LoadNamedFromSuper(name, feedback);
javascript()->LoadNamedFromSuper(name.object(), feedback);
JSTypeHintLowering::LoweringResult lowering = JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedLoadNamed(op, feedback.slot); TryBuildSimplifiedLoadNamed(op, feedback.slot);
...@@ -2186,12 +2182,12 @@ void BytecodeGraphBuilder::BuildNamedStore(StoreMode store_mode) { ...@@ -2186,12 +2182,12 @@ void BytecodeGraphBuilder::BuildNamedStore(StoreMode store_mode) {
DCHECK_EQ(FeedbackSlotKind::kStoreOwnNamed, DCHECK_EQ(FeedbackSlotKind::kStoreOwnNamed,
broker()->GetFeedbackSlotKind(feedback)); broker()->GetFeedbackSlotKind(feedback));
op = javascript()->StoreNamedOwn(name.object(), feedback); op = javascript()->StoreNamedOwn(name, feedback);
} else { } else {
DCHECK_EQ(StoreMode::kNormal, store_mode); DCHECK_EQ(StoreMode::kNormal, store_mode);
LanguageMode language_mode = LanguageMode language_mode =
GetLanguageModeFromSlotKind(broker()->GetFeedbackSlotKind(feedback)); GetLanguageModeFromSlotKind(broker()->GetFeedbackSlotKind(feedback));
op = javascript()->StoreNamed(language_mode, name.object(), feedback); op = javascript()->StoreNamed(language_mode, name, feedback);
} }
JSTypeHintLowering::LoweringResult lowering = JSTypeHintLowering::LoweringResult lowering =
...@@ -2289,10 +2285,10 @@ void BytecodeGraphBuilder::VisitCreateClosure() { ...@@ -2289,10 +2285,10 @@ void BytecodeGraphBuilder::VisitCreateClosure() {
bytecode_iterator().GetFlagOperand(2)) bytecode_iterator().GetFlagOperand(2))
? AllocationType::kOld ? AllocationType::kOld
: AllocationType::kYoung; : AllocationType::kYoung;
Handle<CodeT> compile_lazy = broker()->CanonicalPersistentHandle( CodeTRef compile_lazy = MakeRef(
ToCodeT(*BUILTIN_CODE(jsgraph()->isolate(), CompileLazy))); broker(), ToCodeT(*BUILTIN_CODE(jsgraph()->isolate(), CompileLazy)));
const Operator* op = javascript()->CreateClosure(shared_info.object(), const Operator* op =
compile_lazy, allocation); javascript()->CreateClosure(shared_info, compile_lazy, allocation);
Node* closure = NewNode( Node* closure = NewNode(
op, BuildLoadFeedbackCell(bytecode_iterator().GetIndexOperand(1))); op, BuildLoadFeedbackCell(bytecode_iterator().GetIndexOperand(1)));
environment()->BindAccumulator(closure); environment()->BindAccumulator(closure);
...@@ -2300,7 +2296,7 @@ void BytecodeGraphBuilder::VisitCreateClosure() { ...@@ -2300,7 +2296,7 @@ void BytecodeGraphBuilder::VisitCreateClosure() {
void BytecodeGraphBuilder::VisitCreateBlockContext() { void BytecodeGraphBuilder::VisitCreateBlockContext() {
ScopeInfoRef scope_info = MakeRefForConstantForIndexOperand<ScopeInfo>(0); ScopeInfoRef scope_info = MakeRefForConstantForIndexOperand<ScopeInfo>(0);
const Operator* op = javascript()->CreateBlockContext(scope_info.object()); const Operator* op = javascript()->CreateBlockContext(scope_info);
Node* context = NewNode(op); Node* context = NewNode(op);
environment()->BindAccumulator(context); environment()->BindAccumulator(context);
} }
...@@ -2308,8 +2304,8 @@ void BytecodeGraphBuilder::VisitCreateBlockContext() { ...@@ -2308,8 +2304,8 @@ void BytecodeGraphBuilder::VisitCreateBlockContext() {
void BytecodeGraphBuilder::VisitCreateFunctionContext() { void BytecodeGraphBuilder::VisitCreateFunctionContext() {
ScopeInfoRef scope_info = MakeRefForConstantForIndexOperand<ScopeInfo>(0); ScopeInfoRef scope_info = MakeRefForConstantForIndexOperand<ScopeInfo>(0);
uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(1); uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(1);
const Operator* op = javascript()->CreateFunctionContext( const Operator* op =
scope_info.object(), slots, FUNCTION_SCOPE); javascript()->CreateFunctionContext(scope_info, slots, FUNCTION_SCOPE);
Node* context = NewNode(op); Node* context = NewNode(op);
environment()->BindAccumulator(context); environment()->BindAccumulator(context);
} }
...@@ -2317,8 +2313,8 @@ void BytecodeGraphBuilder::VisitCreateFunctionContext() { ...@@ -2317,8 +2313,8 @@ void BytecodeGraphBuilder::VisitCreateFunctionContext() {
void BytecodeGraphBuilder::VisitCreateEvalContext() { void BytecodeGraphBuilder::VisitCreateEvalContext() {
ScopeInfoRef scope_info = MakeRefForConstantForIndexOperand<ScopeInfo>(0); ScopeInfoRef scope_info = MakeRefForConstantForIndexOperand<ScopeInfo>(0);
uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(1); uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(1);
const Operator* op = javascript()->CreateFunctionContext(scope_info.object(), const Operator* op =
slots, EVAL_SCOPE); javascript()->CreateFunctionContext(scope_info, slots, EVAL_SCOPE);
Node* context = NewNode(op); Node* context = NewNode(op);
environment()->BindAccumulator(context); environment()->BindAccumulator(context);
} }
...@@ -2328,7 +2324,7 @@ void BytecodeGraphBuilder::VisitCreateCatchContext() { ...@@ -2328,7 +2324,7 @@ void BytecodeGraphBuilder::VisitCreateCatchContext() {
Node* exception = environment()->LookupRegister(reg); Node* exception = environment()->LookupRegister(reg);
ScopeInfoRef scope_info = MakeRefForConstantForIndexOperand<ScopeInfo>(1); ScopeInfoRef scope_info = MakeRefForConstantForIndexOperand<ScopeInfo>(1);
const Operator* op = javascript()->CreateCatchContext(scope_info.object()); const Operator* op = javascript()->CreateCatchContext(scope_info);
Node* context = NewNode(op, exception); Node* context = NewNode(op, exception);
environment()->BindAccumulator(context); environment()->BindAccumulator(context);
} }
...@@ -2338,7 +2334,7 @@ void BytecodeGraphBuilder::VisitCreateWithContext() { ...@@ -2338,7 +2334,7 @@ void BytecodeGraphBuilder::VisitCreateWithContext() {
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
ScopeInfoRef scope_info = MakeRefForConstantForIndexOperand<ScopeInfo>(1); ScopeInfoRef scope_info = MakeRefForConstantForIndexOperand<ScopeInfo>(1);
const Operator* op = javascript()->CreateWithContext(scope_info.object()); const Operator* op = javascript()->CreateWithContext(scope_info);
Node* context = NewNode(op, object); Node* context = NewNode(op, object);
environment()->BindAccumulator(context); environment()->BindAccumulator(context);
} }
...@@ -2367,8 +2363,8 @@ void BytecodeGraphBuilder::VisitCreateRegExpLiteral() { ...@@ -2367,8 +2363,8 @@ void BytecodeGraphBuilder::VisitCreateRegExpLiteral() {
FeedbackSource pair = CreateFeedbackSource(slot_id); FeedbackSource pair = CreateFeedbackSource(slot_id);
int literal_flags = bytecode_iterator().GetFlagOperand(2); int literal_flags = bytecode_iterator().GetFlagOperand(2);
STATIC_ASSERT(JSCreateLiteralRegExpNode::FeedbackVectorIndex() == 0); STATIC_ASSERT(JSCreateLiteralRegExpNode::FeedbackVectorIndex() == 0);
const Operator* op = javascript()->CreateLiteralRegExp( const Operator* op =
constant_pattern.object(), pair, literal_flags); javascript()->CreateLiteralRegExp(constant_pattern, pair, literal_flags);
DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode())); DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode()));
Node* literal = NewNode(op, feedback_vector_node()); Node* literal = NewNode(op, feedback_vector_node());
environment()->BindAccumulator(literal, Environment::kAttachFrameState); environment()->BindAccumulator(literal, Environment::kAttachFrameState);
...@@ -2390,9 +2386,8 @@ void BytecodeGraphBuilder::VisitCreateArrayLiteral() { ...@@ -2390,9 +2386,8 @@ void BytecodeGraphBuilder::VisitCreateArrayLiteral() {
int number_of_elements = int number_of_elements =
array_boilerplate_description.constants_elements_length(); array_boilerplate_description.constants_elements_length();
STATIC_ASSERT(JSCreateLiteralArrayNode::FeedbackVectorIndex() == 0); STATIC_ASSERT(JSCreateLiteralArrayNode::FeedbackVectorIndex() == 0);
const Operator* op = const Operator* op = javascript()->CreateLiteralArray(
javascript()->CreateLiteralArray(array_boilerplate_description.object(), array_boilerplate_description, pair, literal_flags, number_of_elements);
pair, literal_flags, number_of_elements);
DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode())); DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode()));
Node* literal = NewNode(op, feedback_vector_node()); Node* literal = NewNode(op, feedback_vector_node());
environment()->BindAccumulator(literal, Environment::kAttachFrameState); environment()->BindAccumulator(literal, Environment::kAttachFrameState);
...@@ -2424,7 +2419,7 @@ void BytecodeGraphBuilder::VisitCreateObjectLiteral() { ...@@ -2424,7 +2419,7 @@ void BytecodeGraphBuilder::VisitCreateObjectLiteral() {
int number_of_properties = constant_properties.size(); int number_of_properties = constant_properties.size();
STATIC_ASSERT(JSCreateLiteralObjectNode::FeedbackVectorIndex() == 0); STATIC_ASSERT(JSCreateLiteralObjectNode::FeedbackVectorIndex() == 0);
const Operator* op = javascript()->CreateLiteralObject( const Operator* op = javascript()->CreateLiteralObject(
constant_properties.object(), pair, literal_flags, number_of_properties); constant_properties, pair, literal_flags, number_of_properties);
DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode())); DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode()));
Node* literal = NewNode(op, feedback_vector_node()); Node* literal = NewNode(op, feedback_vector_node());
environment()->BindAccumulator(literal, Environment::kAttachFrameState); environment()->BindAccumulator(literal, Environment::kAttachFrameState);
...@@ -2456,8 +2451,8 @@ void BytecodeGraphBuilder::VisitGetTemplateObject() { ...@@ -2456,8 +2451,8 @@ void BytecodeGraphBuilder::VisitGetTemplateObject() {
TemplateObjectDescriptionRef description = TemplateObjectDescriptionRef description =
MakeRefForConstantForIndexOperand<TemplateObjectDescription>(0); MakeRefForConstantForIndexOperand<TemplateObjectDescription>(0);
STATIC_ASSERT(JSGetTemplateObjectNode::FeedbackVectorIndex() == 0); STATIC_ASSERT(JSGetTemplateObjectNode::FeedbackVectorIndex() == 0);
const Operator* op = javascript()->GetTemplateObject( const Operator* op =
description.object(), shared_info().object(), source); javascript()->GetTemplateObject(description, shared_info(), source);
DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode())); DCHECK(IrOpcode::IsFeedbackCollectingOpcode(op->opcode()));
Node* template_object = NewNode(op, feedback_vector_node()); Node* template_object = NewNode(op, feedback_vector_node());
environment()->BindAccumulator(template_object); environment()->BindAccumulator(template_object);
......
...@@ -212,6 +212,14 @@ class TinyRef { ...@@ -212,6 +212,14 @@ class TinyRef {
HEAP_BROKER_OBJECT_LIST(V) HEAP_BROKER_OBJECT_LIST(V)
#undef V #undef V
#ifdef V8_EXTERNAL_CODE_SPACE
using CodeTRef = CodeDataContainerRef;
using CodeTTinyRef = CodeDataContainerTinyRef;
#else
using CodeTRef = CodeRef;
using CodeTTinyRef = CodeTinyRef;
#endif
class V8_EXPORT_PRIVATE ObjectRef { class V8_EXPORT_PRIVATE ObjectRef {
public: public:
ObjectRef(JSHeapBroker* broker, ObjectData* data, bool check_type = true) ObjectRef(JSHeapBroker* broker, ObjectData* data, bool check_type = true)
......
...@@ -834,7 +834,7 @@ class PromiseBuiltinReducerAssembler : public JSCallReducerAssembler { ...@@ -834,7 +834,7 @@ class PromiseBuiltinReducerAssembler : public JSCallReducerAssembler {
int slot_count) { int slot_count) {
return AddNode<Context>(graph()->NewNode( return AddNode<Context>(graph()->NewNode(
javascript()->CreateFunctionContext( javascript()->CreateFunctionContext(
native_context.scope_info().object(), native_context.scope_info(),
slot_count - Context::MIN_CONTEXT_SLOTS, FUNCTION_SCOPE), slot_count - Context::MIN_CONTEXT_SLOTS, FUNCTION_SCOPE),
outer_context, effect(), control())); outer_context, effect(), control()));
} }
...@@ -851,11 +851,10 @@ class PromiseBuiltinReducerAssembler : public JSCallReducerAssembler { ...@@ -851,11 +851,10 @@ class PromiseBuiltinReducerAssembler : public JSCallReducerAssembler {
isolate()->factory()->many_closures_cell(); isolate()->factory()->many_closures_cell();
Callable const callable = Callable const callable =
Builtins::CallableFor(isolate(), shared.builtin_id()); Builtins::CallableFor(isolate(), shared.builtin_id());
Handle<CodeT> code = CodeTRef code = MakeRef(broker_, ToCodeT(*callable.code()));
broker_->CanonicalPersistentHandle(ToCodeT(*callable.code()));
return AddNode<JSFunction>(graph()->NewNode( return AddNode<JSFunction>(graph()->NewNode(
javascript()->CreateClosure(shared.object(), code), javascript()->CreateClosure(shared, code), HeapConstant(feedback_cell),
HeapConstant(feedback_cell), context, effect(), control())); context, effect(), control()));
} }
void CallPromiseExecutor(TNode<Object> executor, TNode<JSFunction> resolve, void CallPromiseExecutor(TNode<Object> executor, TNode<JSFunction> resolve,
...@@ -2715,7 +2714,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeBind(Node* node) { ...@@ -2715,7 +2714,7 @@ Reduction JSCallReducer::ReduceFunctionPrototypeBind(Node* node) {
DCHECK_EQ(cursor, input_count); DCHECK_EQ(cursor, input_count);
Node* value = effect = Node* value = effect =
graph()->NewNode(javascript()->CreateBoundFunction( graph()->NewNode(javascript()->CreateBoundFunction(
arity_with_bound_this - kBoundThis, map.object()), arity_with_bound_this - kBoundThis, map),
input_count, inputs); input_count, inputs);
ReplaceWithValue(node, value, effect, control); ReplaceWithValue(node, value, effect, control);
return Replace(value); return Replace(value);
...@@ -4395,7 +4394,7 @@ Reduction JSCallReducer::ReduceJSCall(Node* node) { ...@@ -4395,7 +4394,7 @@ Reduction JSCallReducer::ReduceJSCall(Node* node) {
// Same if the {target} is the result of a CheckClosure operation. // Same if the {target} is the result of a CheckClosure operation.
if (target->opcode() == IrOpcode::kJSCreateClosure) { if (target->opcode() == IrOpcode::kJSCreateClosure) {
CreateClosureParameters const& p = JSCreateClosureNode{target}.Parameters(); CreateClosureParameters const& p = JSCreateClosureNode{target}.Parameters();
return ReduceJSCall(node, MakeRef(broker(), p.shared_info())); return ReduceJSCall(node, p.shared_info(broker()));
} else if (target->opcode() == IrOpcode::kCheckClosure) { } else if (target->opcode() == IrOpcode::kCheckClosure) {
FeedbackCellRef cell = MakeRef(broker(), FeedbackCellOf(target->op())); FeedbackCellRef cell = MakeRef(broker(), FeedbackCellOf(target->op()));
if (cell.shared_function_info().has_value()) { if (cell.shared_function_info().has_value()) {
...@@ -6830,9 +6829,8 @@ Node* JSCallReducer::CreateClosureFromBuiltinSharedFunctionInfo( ...@@ -6830,9 +6829,8 @@ Node* JSCallReducer::CreateClosureFromBuiltinSharedFunctionInfo(
isolate()->factory()->many_closures_cell(); isolate()->factory()->many_closures_cell();
Callable const callable = Callable const callable =
Builtins::CallableFor(isolate(), shared.builtin_id()); Builtins::CallableFor(isolate(), shared.builtin_id());
Handle<CodeT> code = CodeTRef code = MakeRef(broker(), ToCodeT(*callable.code()));
broker()->CanonicalPersistentHandle(ToCodeT(*callable.code())); return graph()->NewNode(javascript()->CreateClosure(shared, code),
return graph()->NewNode(javascript()->CreateClosure(shared.object(), code),
jsgraph()->HeapConstant(feedback_cell), context, jsgraph()->HeapConstant(feedback_cell), context,
effect, control); effect, control);
} }
...@@ -6884,7 +6882,7 @@ Reduction JSCallReducer::ReducePromisePrototypeFinally(Node* node) { ...@@ -6884,7 +6882,7 @@ Reduction JSCallReducer::ReducePromisePrototypeFinally(Node* node) {
// Allocate shared context for the closures below. // Allocate shared context for the closures below.
context = etrue = context = etrue =
graph()->NewNode(javascript()->CreateFunctionContext( graph()->NewNode(javascript()->CreateFunctionContext(
native_context().scope_info().object(), native_context().scope_info(),
PromiseBuiltins::kPromiseFinallyContextLength - PromiseBuiltins::kPromiseFinallyContextLength -
Context::MIN_CONTEXT_SLOTS, Context::MIN_CONTEXT_SLOTS,
FUNCTION_SCOPE), FUNCTION_SCOPE),
......
...@@ -873,7 +873,7 @@ Reduction JSCreateLowering::ReduceJSCreateBoundFunction(Node* node) { ...@@ -873,7 +873,7 @@ Reduction JSCreateLowering::ReduceJSCreateBoundFunction(Node* node) {
CreateBoundFunctionParameters const& p = CreateBoundFunctionParameters const& p =
CreateBoundFunctionParametersOf(node->op()); CreateBoundFunctionParametersOf(node->op());
int const arity = static_cast<int>(p.arity()); int const arity = static_cast<int>(p.arity());
MapRef const map = MakeRef(broker(), p.map()); MapRef const map = p.map(broker());
Node* bound_target_function = NodeProperties::GetValueInput(node, 0); Node* bound_target_function = NodeProperties::GetValueInput(node, 0);
Node* bound_this = NodeProperties::GetValueInput(node, 1); Node* bound_this = NodeProperties::GetValueInput(node, 1);
Node* effect = NodeProperties::GetEffectInput(node); Node* effect = NodeProperties::GetEffectInput(node);
...@@ -914,9 +914,9 @@ Reduction JSCreateLowering::ReduceJSCreateBoundFunction(Node* node) { ...@@ -914,9 +914,9 @@ Reduction JSCreateLowering::ReduceJSCreateBoundFunction(Node* node) {
Reduction JSCreateLowering::ReduceJSCreateClosure(Node* node) { Reduction JSCreateLowering::ReduceJSCreateClosure(Node* node) {
JSCreateClosureNode n(node); JSCreateClosureNode n(node);
CreateClosureParameters const& p = n.Parameters(); CreateClosureParameters const& p = n.Parameters();
SharedFunctionInfoRef shared = MakeRef(broker(), p.shared_info()); SharedFunctionInfoRef shared = p.shared_info(broker());
FeedbackCellRef feedback_cell = n.GetFeedbackCellRefChecked(broker()); FeedbackCellRef feedback_cell = n.GetFeedbackCellRefChecked(broker());
HeapObjectRef code = MakeRef(broker(), p.code()); HeapObjectRef code = p.code(broker());
Effect effect = n.effect(); Effect effect = n.effect();
Control control = n.control(); Control control = n.control();
Node* context = n.context(); Node* context = n.context();
...@@ -1198,7 +1198,7 @@ Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) { ...@@ -1198,7 +1198,7 @@ Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) {
DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, node->opcode()); DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, node->opcode());
const CreateFunctionContextParameters& parameters = const CreateFunctionContextParameters& parameters =
CreateFunctionContextParametersOf(node->op()); CreateFunctionContextParametersOf(node->op());
ScopeInfoRef scope_info = MakeRef(broker(), parameters.scope_info()); ScopeInfoRef scope_info = parameters.scope_info(broker());
int slot_count = parameters.slot_count(); int slot_count = parameters.slot_count();
ScopeType scope_type = parameters.scope_type(); ScopeType scope_type = parameters.scope_type();
...@@ -1238,7 +1238,7 @@ Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) { ...@@ -1238,7 +1238,7 @@ Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) {
Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) { Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) {
DCHECK_EQ(IrOpcode::kJSCreateWithContext, node->opcode()); DCHECK_EQ(IrOpcode::kJSCreateWithContext, node->opcode());
ScopeInfoRef scope_info = MakeRef(broker(), ScopeInfoOf(node->op())); ScopeInfoRef scope_info = ScopeInfoOf(broker(), 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);
...@@ -1259,7 +1259,7 @@ Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) { ...@@ -1259,7 +1259,7 @@ Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) {
Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) { Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) {
DCHECK_EQ(IrOpcode::kJSCreateCatchContext, node->opcode()); DCHECK_EQ(IrOpcode::kJSCreateCatchContext, node->opcode());
ScopeInfoRef scope_info = MakeRef(broker(), ScopeInfoOf(node->op())); ScopeInfoRef scope_info = ScopeInfoOf(broker(), 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);
...@@ -1280,7 +1280,7 @@ Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) { ...@@ -1280,7 +1280,7 @@ Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) {
Reduction JSCreateLowering::ReduceJSCreateBlockContext(Node* node) { Reduction JSCreateLowering::ReduceJSCreateBlockContext(Node* node) {
DCHECK_EQ(IrOpcode::kJSCreateBlockContext, node->opcode()); DCHECK_EQ(IrOpcode::kJSCreateBlockContext, node->opcode());
ScopeInfoRef scope_info = MakeRef(broker(), ScopeInfoOf(node->op())); ScopeInfoRef scope_info = ScopeInfoOf(broker(), 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.
......
...@@ -314,25 +314,23 @@ void JSGenericLowering::LowerJSLoadNamed(Node* node) { ...@@ -314,25 +314,23 @@ void JSGenericLowering::LowerJSLoadNamed(Node* node) {
STATIC_ASSERT(n.FeedbackVectorIndex() == 1); STATIC_ASSERT(n.FeedbackVectorIndex() == 1);
if (!p.feedback().IsValid()) { if (!p.feedback().IsValid()) {
n->RemoveInput(n.FeedbackVectorIndex()); n->RemoveInput(n.FeedbackVectorIndex());
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 1, jsgraph()->Constant(p.name(broker())));
ReplaceWithBuiltinCall(node, Builtin::kGetProperty); ReplaceWithBuiltinCall(node, Builtin::kGetProperty);
} else if (outer_state->opcode() != IrOpcode::kFrameState) { } else if (outer_state->opcode() != IrOpcode::kFrameState) {
n->RemoveInput(n.FeedbackVectorIndex()); n->RemoveInput(n.FeedbackVectorIndex());
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 1, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 2, node->InsertInput(zone(), 2,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
ReplaceWithBuiltinCall( ReplaceWithBuiltinCall(node, ShouldUseMegamorphicLoadBuiltin(
node, ShouldUseMegamorphicLoadBuiltin( p.feedback(), p.name(broker()), broker())
p.feedback(), MakeRef(broker(), p.name()), broker())
? Builtin::kLoadICTrampoline_Megamorphic ? Builtin::kLoadICTrampoline_Megamorphic
: Builtin::kLoadICTrampoline); : Builtin::kLoadICTrampoline);
} else { } else {
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 1, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 2, node->InsertInput(zone(), 2,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
ReplaceWithBuiltinCall( ReplaceWithBuiltinCall(node, ShouldUseMegamorphicLoadBuiltin(
node, ShouldUseMegamorphicLoadBuiltin( p.feedback(), p.name(broker()), broker())
p.feedback(), MakeRef(broker(), p.name()), broker())
? Builtin::kLoadIC_Megamorphic ? Builtin::kLoadIC_Megamorphic
: Builtin::kLoadIC); : Builtin::kLoadIC);
} }
...@@ -359,7 +357,7 @@ void JSGenericLowering::LowerJSLoadNamedFromSuper(Node* node) { ...@@ -359,7 +357,7 @@ void JSGenericLowering::LowerJSLoadNamedFromSuper(Node* node) {
// be double-checked that the FeedbackVector parameter will be the // be double-checked that the FeedbackVector parameter will be the
// UndefinedConstant. // UndefinedConstant.
DCHECK(p.feedback().IsValid()); DCHECK(p.feedback().IsValid());
node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 2, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 3, node->InsertInput(zone(), 3,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
ReplaceWithBuiltinCall(node, Builtin::kLoadSuperIC); ReplaceWithBuiltinCall(node, Builtin::kLoadSuperIC);
...@@ -374,13 +372,13 @@ void JSGenericLowering::LowerJSLoadGlobal(Node* node) { ...@@ -374,13 +372,13 @@ void JSGenericLowering::LowerJSLoadGlobal(Node* node) {
STATIC_ASSERT(n.FeedbackVectorIndex() == 0); STATIC_ASSERT(n.FeedbackVectorIndex() == 0);
if (outer_state->opcode() != IrOpcode::kFrameState) { if (outer_state->opcode() != IrOpcode::kFrameState) {
n->RemoveInput(n.FeedbackVectorIndex()); n->RemoveInput(n.FeedbackVectorIndex());
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 0, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 1, node->InsertInput(zone(), 1,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
Callable callable = CodeFactory::LoadGlobalIC(isolate(), p.typeof_mode()); Callable callable = CodeFactory::LoadGlobalIC(isolate(), p.typeof_mode());
ReplaceWithBuiltinCall(node, callable, flags); ReplaceWithBuiltinCall(node, callable, flags);
} else { } else {
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 0, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 1, node->InsertInput(zone(), 1,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
Callable callable = Callable callable =
...@@ -439,16 +437,16 @@ void JSGenericLowering::LowerJSStoreNamed(Node* node) { ...@@ -439,16 +437,16 @@ void JSGenericLowering::LowerJSStoreNamed(Node* node) {
STATIC_ASSERT(n.FeedbackVectorIndex() == 2); STATIC_ASSERT(n.FeedbackVectorIndex() == 2);
if (!p.feedback().IsValid()) { if (!p.feedback().IsValid()) {
n->RemoveInput(n.FeedbackVectorIndex()); n->RemoveInput(n.FeedbackVectorIndex());
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 1, jsgraph()->Constant(p.name(broker())));
ReplaceWithRuntimeCall(node, Runtime::kSetNamedProperty); ReplaceWithRuntimeCall(node, Runtime::kSetNamedProperty);
} else if (outer_state->opcode() != IrOpcode::kFrameState) { } else if (outer_state->opcode() != IrOpcode::kFrameState) {
n->RemoveInput(n.FeedbackVectorIndex()); n->RemoveInput(n.FeedbackVectorIndex());
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 1, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 3, node->InsertInput(zone(), 3,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
ReplaceWithBuiltinCall(node, Builtin::kStoreICTrampoline); ReplaceWithBuiltinCall(node, Builtin::kStoreICTrampoline);
} else { } else {
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 1, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 3, node->InsertInput(zone(), 3,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
ReplaceWithBuiltinCall(node, Builtin::kStoreIC); ReplaceWithBuiltinCall(node, Builtin::kStoreIC);
...@@ -464,13 +462,13 @@ void JSGenericLowering::LowerJSStoreNamedOwn(Node* node) { ...@@ -464,13 +462,13 @@ void JSGenericLowering::LowerJSStoreNamedOwn(Node* node) {
STATIC_ASSERT(n.FeedbackVectorIndex() == 2); STATIC_ASSERT(n.FeedbackVectorIndex() == 2);
if (outer_state->opcode() != IrOpcode::kFrameState) { if (outer_state->opcode() != IrOpcode::kFrameState) {
n->RemoveInput(n.FeedbackVectorIndex()); n->RemoveInput(n.FeedbackVectorIndex());
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 1, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 3, node->InsertInput(zone(), 3,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
Callable callable = CodeFactory::StoreOwnIC(isolate()); Callable callable = CodeFactory::StoreOwnIC(isolate());
ReplaceWithBuiltinCall(node, callable, flags); ReplaceWithBuiltinCall(node, callable, flags);
} else { } else {
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 1, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 3, node->InsertInput(zone(), 3,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
Callable callable = CodeFactory::StoreOwnICInOptimizedCode(isolate()); Callable callable = CodeFactory::StoreOwnICInOptimizedCode(isolate());
...@@ -486,12 +484,12 @@ void JSGenericLowering::LowerJSStoreGlobal(Node* node) { ...@@ -486,12 +484,12 @@ void JSGenericLowering::LowerJSStoreGlobal(Node* node) {
STATIC_ASSERT(n.FeedbackVectorIndex() == 1); STATIC_ASSERT(n.FeedbackVectorIndex() == 1);
if (outer_state->opcode() != IrOpcode::kFrameState) { if (outer_state->opcode() != IrOpcode::kFrameState) {
n->RemoveInput(n.FeedbackVectorIndex()); n->RemoveInput(n.FeedbackVectorIndex());
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 0, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 2, node->InsertInput(zone(), 2,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
ReplaceWithBuiltinCall(node, Builtin::kStoreGlobalICTrampoline); ReplaceWithBuiltinCall(node, Builtin::kStoreGlobalICTrampoline);
} else { } else {
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.name())); node->InsertInput(zone(), 0, jsgraph()->Constant(p.name(broker())));
node->InsertInput(zone(), 2, node->InsertInput(zone(), 2,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
ReplaceWithBuiltinCall(node, Builtin::kStoreGlobalIC); ReplaceWithBuiltinCall(node, Builtin::kStoreGlobalIC);
...@@ -643,9 +641,9 @@ void JSGenericLowering::LowerJSRegExpTest(Node* node) { ...@@ -643,9 +641,9 @@ void JSGenericLowering::LowerJSRegExpTest(Node* node) {
void JSGenericLowering::LowerJSCreateClosure(Node* node) { void JSGenericLowering::LowerJSCreateClosure(Node* node) {
JSCreateClosureNode n(node); JSCreateClosureNode n(node);
CreateClosureParameters const& p = n.Parameters(); CreateClosureParameters const& p = n.Parameters();
Handle<SharedFunctionInfo> const shared_info = p.shared_info(); SharedFunctionInfoRef shared_info = p.shared_info(broker());
STATIC_ASSERT(n.FeedbackCellIndex() == 0); STATIC_ASSERT(n.FeedbackCellIndex() == 0);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(shared_info)); node->InsertInput(zone(), 0, jsgraph()->Constant(shared_info));
node->RemoveInput(4); // control node->RemoveInput(4); // control
// Use the FastNewClosure builtin only for functions allocated in new space. // Use the FastNewClosure builtin only for functions allocated in new space.
...@@ -659,7 +657,7 @@ void JSGenericLowering::LowerJSCreateClosure(Node* node) { ...@@ -659,7 +657,7 @@ void JSGenericLowering::LowerJSCreateClosure(Node* node) {
void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) {
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(broker());
int slot_count = parameters.slot_count(); int slot_count = parameters.slot_count();
ScopeType scope_type = parameters.scope_type(); ScopeType scope_type = parameters.scope_type();
CallDescriptor::Flags flags = FrameStateFlagForCall(node); CallDescriptor::Flags flags = FrameStateFlagForCall(node);
...@@ -667,11 +665,11 @@ void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { ...@@ -667,11 +665,11 @@ void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) {
if (slot_count <= ConstructorBuiltins::MaximumFunctionContextSlots()) { if (slot_count <= ConstructorBuiltins::MaximumFunctionContextSlots()) {
Callable callable = Callable callable =
CodeFactory::FastNewFunctionContext(isolate(), scope_type); CodeFactory::FastNewFunctionContext(isolate(), scope_type);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(scope_info)); node->InsertInput(zone(), 0, jsgraph()->Constant(scope_info));
node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count));
ReplaceWithBuiltinCall(node, callable, flags); ReplaceWithBuiltinCall(node, callable, flags);
} else { } else {
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(scope_info)); node->InsertInput(zone(), 0, jsgraph()->Constant(scope_info));
ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext); ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext);
} }
} }
...@@ -707,7 +705,7 @@ void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { ...@@ -707,7 +705,7 @@ void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) {
STATIC_ASSERT(n.FeedbackVectorIndex() == 0); STATIC_ASSERT(n.FeedbackVectorIndex() == 0);
node->InsertInput(zone(), 1, node->InsertInput(zone(), 1,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant())); node->InsertInput(zone(), 2, jsgraph()->Constant(p.constant(broker())));
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags())); node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags()));
// Use the CreateShallowArrayLiteral builtin only for shallow boilerplates // Use the CreateShallowArrayLiteral builtin only for shallow boilerplates
...@@ -723,8 +721,8 @@ void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { ...@@ -723,8 +721,8 @@ void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) {
void JSGenericLowering::LowerJSGetTemplateObject(Node* node) { void JSGenericLowering::LowerJSGetTemplateObject(Node* node) {
JSGetTemplateObjectNode n(node); JSGetTemplateObjectNode n(node);
GetTemplateObjectParameters const& p = n.Parameters(); GetTemplateObjectParameters const& p = n.Parameters();
SharedFunctionInfoRef shared = MakeRef(broker(), p.shared()); SharedFunctionInfoRef shared = p.shared(broker());
TemplateObjectDescriptionRef description = MakeRef(broker(), p.description()); TemplateObjectDescriptionRef description = p.description(broker());
DCHECK_EQ(node->op()->ControlInputCount(), 1); DCHECK_EQ(node->op()->ControlInputCount(), 1);
node->RemoveInput(NodeProperties::FirstControlIndex(node)); node->RemoveInput(NodeProperties::FirstControlIndex(node));
...@@ -758,7 +756,7 @@ void JSGenericLowering::LowerJSCreateLiteralObject(Node* node) { ...@@ -758,7 +756,7 @@ void JSGenericLowering::LowerJSCreateLiteralObject(Node* node) {
STATIC_ASSERT(n.FeedbackVectorIndex() == 0); STATIC_ASSERT(n.FeedbackVectorIndex() == 0);
node->InsertInput(zone(), 1, node->InsertInput(zone(), 1,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant())); node->InsertInput(zone(), 2, jsgraph()->Constant(p.constant(broker())));
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags())); node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags()));
// Use the CreateShallowObjectLiteratal builtin only for shallow boilerplates // Use the CreateShallowObjectLiteratal builtin only for shallow boilerplates
...@@ -792,27 +790,27 @@ void JSGenericLowering::LowerJSCreateLiteralRegExp(Node* node) { ...@@ -792,27 +790,27 @@ void JSGenericLowering::LowerJSCreateLiteralRegExp(Node* node) {
STATIC_ASSERT(n.FeedbackVectorIndex() == 0); STATIC_ASSERT(n.FeedbackVectorIndex() == 0);
node->InsertInput(zone(), 1, node->InsertInput(zone(), 1,
jsgraph()->TaggedIndexConstant(p.feedback().index())); jsgraph()->TaggedIndexConstant(p.feedback().index()));
node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant())); node->InsertInput(zone(), 2, jsgraph()->Constant(p.constant(broker())));
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags())); node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags()));
ReplaceWithBuiltinCall(node, Builtin::kCreateRegExpLiteral); ReplaceWithBuiltinCall(node, Builtin::kCreateRegExpLiteral);
} }
void JSGenericLowering::LowerJSCreateCatchContext(Node* node) { void JSGenericLowering::LowerJSCreateCatchContext(Node* node) {
Handle<ScopeInfo> scope_info = ScopeInfoOf(node->op()); ScopeInfoRef scope_info = ScopeInfoOf(broker(), node->op());
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(scope_info)); node->InsertInput(zone(), 1, jsgraph()->Constant(scope_info));
ReplaceWithRuntimeCall(node, Runtime::kPushCatchContext); ReplaceWithRuntimeCall(node, Runtime::kPushCatchContext);
} }
void JSGenericLowering::LowerJSCreateWithContext(Node* node) { void JSGenericLowering::LowerJSCreateWithContext(Node* node) {
Handle<ScopeInfo> scope_info = ScopeInfoOf(node->op()); ScopeInfoRef scope_info = ScopeInfoOf(broker(), node->op());
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(scope_info)); node->InsertInput(zone(), 1, jsgraph()->Constant(scope_info));
ReplaceWithRuntimeCall(node, Runtime::kPushWithContext); ReplaceWithRuntimeCall(node, Runtime::kPushWithContext);
} }
void JSGenericLowering::LowerJSCreateBlockContext(Node* node) { void JSGenericLowering::LowerJSCreateBlockContext(Node* node) {
Handle<ScopeInfo> scope_info = ScopeInfoOf(node->op()); ScopeInfoRef scope_info = ScopeInfoOf(broker(), node->op());
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(scope_info)); node->InsertInput(zone(), 0, jsgraph()->Constant(scope_info));
ReplaceWithRuntimeCall(node, Runtime::kPushBlockContext); ReplaceWithRuntimeCall(node, Runtime::kPushBlockContext);
} }
......
...@@ -46,23 +46,23 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) { ...@@ -46,23 +46,23 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
break; break;
} }
case IrOpcode::kJSCreateBlockContext: { case IrOpcode::kJSCreateBlockContext: {
MakeRef(broker(), ScopeInfoOf(node->op())); USE(ScopeInfoOf(broker(), node->op()));
break; break;
} }
case IrOpcode::kJSCreateBoundFunction: { case IrOpcode::kJSCreateBoundFunction: {
CreateBoundFunctionParameters const& p = CreateBoundFunctionParameters const& p =
CreateBoundFunctionParametersOf(node->op()); CreateBoundFunctionParametersOf(node->op());
MakeRef(broker(), p.map()); p.map(broker());
break; break;
} }
case IrOpcode::kJSCreateCatchContext: { case IrOpcode::kJSCreateCatchContext: {
MakeRef(broker(), ScopeInfoOf(node->op())); USE(ScopeInfoOf(broker(), node->op()));
break; break;
} }
case IrOpcode::kJSCreateClosure: { case IrOpcode::kJSCreateClosure: {
CreateClosureParameters const& p = CreateClosureParametersOf(node->op()); CreateClosureParameters const& p = CreateClosureParametersOf(node->op());
MakeRef(broker(), p.shared_info()); p.shared_info(broker());
MakeRef(broker(), p.code()); p.code(broker());
break; break;
} }
case IrOpcode::kJSCreateEmptyLiteralArray: { case IrOpcode::kJSCreateEmptyLiteralArray: {
...@@ -119,7 +119,7 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) { ...@@ -119,7 +119,7 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
case IrOpcode::kJSCreateFunctionContext: { case IrOpcode::kJSCreateFunctionContext: {
CreateFunctionContextParameters const& p = CreateFunctionContextParameters const& p =
CreateFunctionContextParametersOf(node->op()); CreateFunctionContextParametersOf(node->op());
MakeRef(broker(), p.scope_info()); p.scope_info(broker());
break; break;
} }
case IrOpcode::kJSCreateLiteralArray: case IrOpcode::kJSCreateLiteralArray:
...@@ -140,18 +140,18 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) { ...@@ -140,18 +140,18 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
case IrOpcode::kJSGetTemplateObject: { case IrOpcode::kJSGetTemplateObject: {
GetTemplateObjectParameters const& p = GetTemplateObjectParameters const& p =
GetTemplateObjectParametersOf(node->op()); GetTemplateObjectParametersOf(node->op());
MakeRef(broker(), p.shared()); p.shared(broker());
MakeRef(broker(), p.description()); p.description(broker());
broker()->GetFeedbackForTemplateObject(p.feedback()); broker()->GetFeedbackForTemplateObject(p.feedback());
break; break;
} }
case IrOpcode::kJSCreateWithContext: { case IrOpcode::kJSCreateWithContext: {
MakeRef(broker(), ScopeInfoOf(node->op())); USE(ScopeInfoOf(broker(), node->op()));
break; break;
} }
case IrOpcode::kJSLoadNamed: { case IrOpcode::kJSLoadNamed: {
NamedAccess const& p = NamedAccessOf(node->op()); NamedAccess const& p = NamedAccessOf(node->op());
NameRef name = MakeRef(broker(), p.name()); NameRef name = p.name(broker());
if (p.feedback().IsValid()) { if (p.feedback().IsValid()) {
broker()->GetFeedbackForPropertyAccess(p.feedback(), AccessMode::kLoad, broker()->GetFeedbackForPropertyAccess(p.feedback(), AccessMode::kLoad,
name); name);
...@@ -160,7 +160,7 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) { ...@@ -160,7 +160,7 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
} }
case IrOpcode::kJSLoadNamedFromSuper: { case IrOpcode::kJSLoadNamedFromSuper: {
NamedAccess const& p = NamedAccessOf(node->op()); NamedAccess const& p = NamedAccessOf(node->op());
NameRef name = MakeRef(broker(), p.name()); NameRef name = p.name(broker());
if (p.feedback().IsValid()) { if (p.feedback().IsValid()) {
broker()->GetFeedbackForPropertyAccess(p.feedback(), AccessMode::kLoad, broker()->GetFeedbackForPropertyAccess(p.feedback(), AccessMode::kLoad,
name); name);
...@@ -169,7 +169,7 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) { ...@@ -169,7 +169,7 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
} }
case IrOpcode::kJSStoreNamed: { case IrOpcode::kJSStoreNamed: {
NamedAccess const& p = NamedAccessOf(node->op()); NamedAccess const& p = NamedAccessOf(node->op());
MakeRef(broker(), p.name()); p.name(broker());
break; break;
} }
case IrOpcode::kStoreField: case IrOpcode::kStoreField:
......
...@@ -111,7 +111,7 @@ JSInliningHeuristic::Candidate JSInliningHeuristic::CollectFunctions( ...@@ -111,7 +111,7 @@ JSInliningHeuristic::Candidate JSInliningHeuristic::CollectFunctions(
JSCreateClosureNode n(callee); JSCreateClosureNode n(callee);
CreateClosureParameters const& p = n.Parameters(); CreateClosureParameters const& p = n.Parameters();
FeedbackCellRef feedback_cell = n.GetFeedbackCellRefChecked(broker()); FeedbackCellRef feedback_cell = n.GetFeedbackCellRefChecked(broker());
SharedFunctionInfoRef shared_info = MakeRef(broker(), p.shared_info()); SharedFunctionInfoRef shared_info = p.shared_info(broker());
out.shared_info = shared_info; out.shared_info = shared_info;
if (feedback_cell.value().has_value() && if (feedback_cell.value().has_value() &&
CanConsiderForInlining(broker(), shared_info, *feedback_cell.value())) { CanConsiderForInlining(broker(), shared_info, *feedback_cell.value())) {
......
...@@ -1002,9 +1002,9 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadGlobal(Node* node) { ...@@ -1002,9 +1002,9 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadGlobal(Node* node) {
ReplaceWithValue(node, value, effect); ReplaceWithValue(node, value, effect);
return Replace(value); return Replace(value);
} else if (feedback.IsPropertyCell()) { } else if (feedback.IsPropertyCell()) {
return ReduceGlobalAccess(node, nullptr, nullptr, nullptr, return ReduceGlobalAccess(node, nullptr, nullptr, nullptr, p.name(broker()),
MakeRef(broker(), p.name()), AccessMode::kLoad, AccessMode::kLoad, nullptr,
nullptr, feedback.property_cell()); feedback.property_cell());
} else { } else {
DCHECK(feedback.IsMegamorphic()); DCHECK(feedback.IsMegamorphic());
return NoChange(); return NoChange();
...@@ -1033,9 +1033,9 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreGlobal(Node* node) { ...@@ -1033,9 +1033,9 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreGlobal(Node* node) {
ReplaceWithValue(node, value, effect, control); ReplaceWithValue(node, value, effect, control);
return Replace(value); return Replace(value);
} else if (feedback.IsPropertyCell()) { } else if (feedback.IsPropertyCell()) {
return ReduceGlobalAccess(node, nullptr, nullptr, value, return ReduceGlobalAccess(node, nullptr, nullptr, value, p.name(broker()),
MakeRef(broker(), p.name()), AccessMode::kStore, AccessMode::kStore, nullptr,
nullptr, feedback.property_cell()); feedback.property_cell());
} else { } else {
DCHECK(feedback.IsMegamorphic()); DCHECK(feedback.IsMegamorphic());
return NoChange(); return NoChange();
...@@ -1441,7 +1441,7 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadNamed(Node* node) { ...@@ -1441,7 +1441,7 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadNamed(Node* node) {
JSLoadNamedNode n(node); JSLoadNamedNode n(node);
NamedAccess const& p = n.Parameters(); NamedAccess const& p = n.Parameters();
Node* const receiver = n.object(); Node* const receiver = n.object();
NameRef name = MakeRef(broker(), p.name()); NameRef name = p.name(broker());
// Check if we have a constant receiver. // Check if we have a constant receiver.
HeapObjectMatcher m(receiver); HeapObjectMatcher m(receiver);
...@@ -1481,7 +1481,7 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadNamedFromSuper( ...@@ -1481,7 +1481,7 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadNamedFromSuper(
Node* node) { Node* node) {
JSLoadNamedFromSuperNode n(node); JSLoadNamedFromSuperNode n(node);
NamedAccess const& p = n.Parameters(); NamedAccess const& p = n.Parameters();
NameRef name = MakeRef(broker(), p.name()); NameRef name = p.name(broker());
if (!p.feedback().IsValid()) return NoChange(); if (!p.feedback().IsValid()) return NoChange();
return ReducePropertyAccess(node, nullptr, name, jsgraph()->Dead(), return ReducePropertyAccess(node, nullptr, name, jsgraph()->Dead(),
...@@ -1499,7 +1499,7 @@ Reduction JSNativeContextSpecialization::ReduceJSGetIterator(Node* node) { ...@@ -1499,7 +1499,7 @@ Reduction JSNativeContextSpecialization::ReduceJSGetIterator(Node* node) {
Control control = n.control(); Control control = n.control();
// Load iterator property operator // Load iterator property operator
Handle<Name> iterator_symbol = factory()->iterator_symbol(); NameRef iterator_symbol = MakeRef(broker(), factory()->iterator_symbol());
const Operator* load_op = const Operator* load_op =
javascript()->LoadNamed(iterator_symbol, p.loadFeedback()); javascript()->LoadNamed(iterator_symbol, p.loadFeedback());
...@@ -1576,17 +1576,16 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreNamed(Node* node) { ...@@ -1576,17 +1576,16 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreNamed(Node* node) {
JSStoreNamedNode n(node); JSStoreNamedNode n(node);
NamedAccess const& p = n.Parameters(); NamedAccess const& p = n.Parameters();
if (!p.feedback().IsValid()) return NoChange(); if (!p.feedback().IsValid()) return NoChange();
return ReducePropertyAccess(node, nullptr, MakeRef(broker(), p.name()), return ReducePropertyAccess(node, nullptr, p.name(broker()), n.value(),
n.value(), FeedbackSource(p.feedback()), FeedbackSource(p.feedback()), AccessMode::kStore);
AccessMode::kStore);
} }
Reduction JSNativeContextSpecialization::ReduceJSStoreNamedOwn(Node* node) { Reduction JSNativeContextSpecialization::ReduceJSStoreNamedOwn(Node* node) {
JSStoreNamedOwnNode n(node); JSStoreNamedOwnNode n(node);
StoreNamedOwnParameters const& p = n.Parameters(); StoreNamedOwnParameters const& p = n.Parameters();
if (!p.feedback().IsValid()) return NoChange(); if (!p.feedback().IsValid()) return NoChange();
return ReducePropertyAccess(node, nullptr, MakeRef(broker(), p.name()), return ReducePropertyAccess(node, nullptr, p.name(broker()), n.value(),
n.value(), FeedbackSource(p.feedback()), FeedbackSource(p.feedback()),
AccessMode::kStoreInLiteral); AccessMode::kStoreInLiteral);
} }
......
...@@ -28,6 +28,12 @@ constexpr Operator::Properties BinopProperties(Operator::Opcode opcode) { ...@@ -28,6 +28,12 @@ constexpr Operator::Properties BinopProperties(Operator::Opcode opcode) {
: Operator::kNoProperties; : Operator::kNoProperties;
} }
template <class T>
Address AddressOrNull(base::Optional<T> ref) {
if (!ref.has_value()) return kNullAddress;
return ref->object().address();
}
} // namespace } // namespace
namespace js_node_wrapper_utils { namespace js_node_wrapper_utils {
...@@ -177,15 +183,10 @@ ContextAccess const& ContextAccessOf(Operator const* op) { ...@@ -177,15 +183,10 @@ ContextAccess const& ContextAccessOf(Operator const* op) {
return OpParameter<ContextAccess>(op); return OpParameter<ContextAccess>(op);
} }
CreateFunctionContextParameters::CreateFunctionContextParameters(
Handle<ScopeInfo> scope_info, int slot_count, ScopeType scope_type)
: scope_info_(scope_info),
slot_count_(slot_count),
scope_type_(scope_type) {}
bool operator==(CreateFunctionContextParameters const& lhs, bool operator==(CreateFunctionContextParameters const& lhs,
CreateFunctionContextParameters const& rhs) { CreateFunctionContextParameters const& rhs) {
return lhs.scope_info().location() == rhs.scope_info().location() && return lhs.scope_info_.object().location() ==
rhs.scope_info_.object().location() &&
lhs.slot_count() == rhs.slot_count() && lhs.slot_count() == rhs.slot_count() &&
lhs.scope_type() == rhs.scope_type(); lhs.scope_type() == rhs.scope_type();
} }
...@@ -196,7 +197,7 @@ bool operator!=(CreateFunctionContextParameters const& lhs, ...@@ -196,7 +197,7 @@ bool operator!=(CreateFunctionContextParameters const& lhs,
} }
size_t hash_value(CreateFunctionContextParameters const& parameters) { size_t hash_value(CreateFunctionContextParameters const& parameters) {
return base::hash_combine(parameters.scope_info().location(), return base::hash_combine(parameters.scope_info_.object().location(),
parameters.slot_count(), parameters.slot_count(),
static_cast<int>(parameters.scope_type())); static_cast<int>(parameters.scope_type()));
} }
...@@ -214,7 +215,7 @@ CreateFunctionContextParameters const& CreateFunctionContextParametersOf( ...@@ -214,7 +215,7 @@ CreateFunctionContextParameters const& CreateFunctionContextParametersOf(
bool operator==(StoreNamedOwnParameters const& lhs, bool operator==(StoreNamedOwnParameters const& lhs,
StoreNamedOwnParameters const& rhs) { StoreNamedOwnParameters const& rhs) {
return lhs.name().location() == rhs.name().location() && return lhs.name_.object().location() == rhs.name_.object().location() &&
lhs.feedback() == rhs.feedback(); lhs.feedback() == rhs.feedback();
} }
...@@ -224,12 +225,12 @@ bool operator!=(StoreNamedOwnParameters const& lhs, ...@@ -224,12 +225,12 @@ bool operator!=(StoreNamedOwnParameters const& lhs,
} }
size_t hash_value(StoreNamedOwnParameters const& p) { size_t hash_value(StoreNamedOwnParameters const& p) {
return base::hash_combine(p.name().location(), return base::hash_combine(p.name_.object().location(),
FeedbackSource::Hash()(p.feedback())); FeedbackSource::Hash()(p.feedback()));
} }
std::ostream& operator<<(std::ostream& os, StoreNamedOwnParameters const& p) { std::ostream& operator<<(std::ostream& os, StoreNamedOwnParameters const& p) {
return os << Brief(*p.name()); return os << Brief(*p.name_.object());
} }
StoreNamedOwnParameters const& StoreNamedOwnParametersOf(const Operator* op) { StoreNamedOwnParameters const& StoreNamedOwnParametersOf(const Operator* op) {
...@@ -264,7 +265,7 @@ FeedbackParameter const& FeedbackParameterOf(const Operator* op) { ...@@ -264,7 +265,7 @@ FeedbackParameter const& FeedbackParameterOf(const Operator* op) {
} }
bool operator==(NamedAccess const& lhs, NamedAccess const& rhs) { bool operator==(NamedAccess const& lhs, NamedAccess const& rhs) {
return lhs.name().location() == rhs.name().location() && return lhs.name_.object().location() == rhs.name_.object().location() &&
lhs.language_mode() == rhs.language_mode() && lhs.language_mode() == rhs.language_mode() &&
lhs.feedback() == rhs.feedback(); lhs.feedback() == rhs.feedback();
} }
...@@ -276,13 +277,13 @@ bool operator!=(NamedAccess const& lhs, NamedAccess const& rhs) { ...@@ -276,13 +277,13 @@ bool operator!=(NamedAccess const& lhs, NamedAccess const& rhs) {
size_t hash_value(NamedAccess const& p) { size_t hash_value(NamedAccess const& p) {
return base::hash_combine(p.name().location(), p.language_mode(), return base::hash_combine(p.name_.object().location(), p.language_mode(),
FeedbackSource::Hash()(p.feedback())); FeedbackSource::Hash()(p.feedback()));
} }
std::ostream& operator<<(std::ostream& os, NamedAccess const& p) { std::ostream& operator<<(std::ostream& os, NamedAccess const& p) {
return os << Brief(*p.name()) << ", " << p.language_mode(); return os << Brief(*p.name_.object()) << ", " << p.language_mode();
} }
...@@ -326,7 +327,7 @@ size_t hash_value(PropertyAccess const& p) { ...@@ -326,7 +327,7 @@ size_t hash_value(PropertyAccess const& p) {
bool operator==(LoadGlobalParameters const& lhs, bool operator==(LoadGlobalParameters const& lhs,
LoadGlobalParameters const& rhs) { LoadGlobalParameters const& rhs) {
return lhs.name().location() == rhs.name().location() && return lhs.name_.object().location() == rhs.name_.object().location() &&
lhs.feedback() == rhs.feedback() && lhs.feedback() == rhs.feedback() &&
lhs.typeof_mode() == rhs.typeof_mode(); lhs.typeof_mode() == rhs.typeof_mode();
} }
...@@ -339,13 +340,14 @@ bool operator!=(LoadGlobalParameters const& lhs, ...@@ -339,13 +340,14 @@ bool operator!=(LoadGlobalParameters const& lhs,
size_t hash_value(LoadGlobalParameters const& p) { size_t hash_value(LoadGlobalParameters const& p) {
return base::hash_combine(p.name().location(), return base::hash_combine(p.name_.object().location(),
static_cast<int>(p.typeof_mode())); static_cast<int>(p.typeof_mode()));
} }
std::ostream& operator<<(std::ostream& os, LoadGlobalParameters const& p) { std::ostream& operator<<(std::ostream& os, LoadGlobalParameters const& p) {
return os << Brief(*p.name()) << ", " << static_cast<int>(p.typeof_mode()); return os << Brief(*p.name_.object()) << ", "
<< static_cast<int>(p.typeof_mode());
} }
...@@ -358,7 +360,7 @@ const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op) { ...@@ -358,7 +360,7 @@ const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op) {
bool operator==(StoreGlobalParameters const& lhs, bool operator==(StoreGlobalParameters const& lhs,
StoreGlobalParameters const& rhs) { StoreGlobalParameters const& rhs) {
return lhs.language_mode() == rhs.language_mode() && return lhs.language_mode() == rhs.language_mode() &&
lhs.name().location() == rhs.name().location() && lhs.name_.object().location() == rhs.name_.object().location() &&
lhs.feedback() == rhs.feedback(); lhs.feedback() == rhs.feedback();
} }
...@@ -370,13 +372,13 @@ bool operator!=(StoreGlobalParameters const& lhs, ...@@ -370,13 +372,13 @@ bool operator!=(StoreGlobalParameters const& lhs,
size_t hash_value(StoreGlobalParameters const& p) { size_t hash_value(StoreGlobalParameters const& p) {
return base::hash_combine(p.language_mode(), p.name().location(), return base::hash_combine(p.language_mode(), p.name_.object().location(),
FeedbackSource::Hash()(p.feedback())); FeedbackSource::Hash()(p.feedback()));
} }
std::ostream& operator<<(std::ostream& os, StoreGlobalParameters const& p) { std::ostream& operator<<(std::ostream& os, StoreGlobalParameters const& p) {
return os << p.language_mode() << ", " << Brief(*p.name()); return os << p.language_mode() << ", " << Brief(*p.name_.object());
} }
...@@ -391,16 +393,6 @@ CreateArgumentsType const& CreateArgumentsTypeOf(const Operator* op) { ...@@ -391,16 +393,6 @@ CreateArgumentsType const& CreateArgumentsTypeOf(const Operator* op) {
return OpParameter<CreateArgumentsType>(op); return OpParameter<CreateArgumentsType>(op);
} }
namespace {
template <class T>
Address AddressOrNull(base::Optional<T> ref) {
if (!ref.has_value()) return kNullAddress;
return ref->object().address();
}
} // namespace
bool operator==(CreateArrayParameters const& lhs, bool operator==(CreateArrayParameters const& lhs,
CreateArrayParameters const& rhs) { CreateArrayParameters const& rhs) {
return lhs.arity() == rhs.arity() && return lhs.arity() == rhs.arity() &&
...@@ -487,7 +479,7 @@ const CreateCollectionIteratorParameters& CreateCollectionIteratorParametersOf( ...@@ -487,7 +479,7 @@ const CreateCollectionIteratorParameters& CreateCollectionIteratorParametersOf(
bool operator==(CreateBoundFunctionParameters const& lhs, bool operator==(CreateBoundFunctionParameters const& lhs,
CreateBoundFunctionParameters const& rhs) { CreateBoundFunctionParameters const& rhs) {
return lhs.arity() == rhs.arity() && return lhs.arity() == rhs.arity() &&
lhs.map().location() == rhs.map().location(); lhs.map_.object().location() == rhs.map_.object().location();
} }
bool operator!=(CreateBoundFunctionParameters const& lhs, bool operator!=(CreateBoundFunctionParameters const& lhs,
...@@ -496,13 +488,13 @@ bool operator!=(CreateBoundFunctionParameters const& lhs, ...@@ -496,13 +488,13 @@ bool operator!=(CreateBoundFunctionParameters const& lhs,
} }
size_t hash_value(CreateBoundFunctionParameters const& p) { size_t hash_value(CreateBoundFunctionParameters const& p) {
return base::hash_combine(p.arity(), p.map().location()); return base::hash_combine(p.arity(), p.map_.object().location());
} }
std::ostream& operator<<(std::ostream& os, std::ostream& operator<<(std::ostream& os,
CreateBoundFunctionParameters const& p) { CreateBoundFunctionParameters const& p) {
os << p.arity(); os << p.arity();
if (!p.map().is_null()) os << ", " << Brief(*p.map()); if (!p.map_.object().is_null()) os << ", " << Brief(*p.map_.object());
return os; return os;
} }
...@@ -514,8 +506,9 @@ const CreateBoundFunctionParameters& CreateBoundFunctionParametersOf( ...@@ -514,8 +506,9 @@ const CreateBoundFunctionParameters& CreateBoundFunctionParametersOf(
bool operator==(GetTemplateObjectParameters const& lhs, bool operator==(GetTemplateObjectParameters const& lhs,
GetTemplateObjectParameters const& rhs) { GetTemplateObjectParameters const& rhs) {
return lhs.description().location() == rhs.description().location() && return lhs.description_.object().location() ==
lhs.shared().location() == rhs.shared().location() && rhs.description_.object().location() &&
lhs.shared_.object().location() == rhs.shared_.object().location() &&
lhs.feedback() == rhs.feedback(); lhs.feedback() == rhs.feedback();
} }
...@@ -525,13 +518,15 @@ bool operator!=(GetTemplateObjectParameters const& lhs, ...@@ -525,13 +518,15 @@ bool operator!=(GetTemplateObjectParameters const& lhs,
} }
size_t hash_value(GetTemplateObjectParameters const& p) { size_t hash_value(GetTemplateObjectParameters const& p) {
return base::hash_combine(p.description().location(), p.shared().location(), return base::hash_combine(p.description_.object().location(),
p.shared_.object().location(),
FeedbackSource::Hash()(p.feedback())); FeedbackSource::Hash()(p.feedback()));
} }
std::ostream& operator<<(std::ostream& os, std::ostream& operator<<(std::ostream& os,
GetTemplateObjectParameters const& p) { GetTemplateObjectParameters const& p) {
return os << Brief(*p.description()) << ", " << Brief(*p.shared()); return os << Brief(*p.description_.object()) << ", "
<< Brief(*p.shared_.object());
} }
const GetTemplateObjectParameters& GetTemplateObjectParametersOf( const GetTemplateObjectParameters& GetTemplateObjectParametersOf(
...@@ -543,8 +538,9 @@ const GetTemplateObjectParameters& GetTemplateObjectParametersOf( ...@@ -543,8 +538,9 @@ const GetTemplateObjectParameters& GetTemplateObjectParametersOf(
bool operator==(CreateClosureParameters const& lhs, bool operator==(CreateClosureParameters const& lhs,
CreateClosureParameters const& rhs) { CreateClosureParameters const& rhs) {
return lhs.allocation() == rhs.allocation() && return lhs.allocation() == rhs.allocation() &&
lhs.code().location() == rhs.code().location() && lhs.code_.object().location() == rhs.code_.object().location() &&
lhs.shared_info().location() == rhs.shared_info().location(); lhs.shared_info_.object().location() ==
rhs.shared_info_.object().location();
} }
...@@ -555,13 +551,14 @@ bool operator!=(CreateClosureParameters const& lhs, ...@@ -555,13 +551,14 @@ bool operator!=(CreateClosureParameters const& lhs,
size_t hash_value(CreateClosureParameters const& p) { size_t hash_value(CreateClosureParameters const& p) {
return base::hash_combine(p.allocation(), p.shared_info().location()); return base::hash_combine(p.allocation(), p.code_.object().location(),
p.shared_info_.object().location());
} }
std::ostream& operator<<(std::ostream& os, CreateClosureParameters const& p) { std::ostream& operator<<(std::ostream& os, CreateClosureParameters const& p) {
return os << p.allocation() << ", " << Brief(*p.shared_info()) << ", " return os << p.allocation() << ", " << Brief(*p.shared_info_.object()) << ", "
<< Brief(*p.code()); << Brief(*p.code_.object());
} }
...@@ -573,7 +570,8 @@ const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) { ...@@ -573,7 +570,8 @@ const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) {
bool operator==(CreateLiteralParameters const& lhs, bool operator==(CreateLiteralParameters const& lhs,
CreateLiteralParameters const& rhs) { CreateLiteralParameters const& rhs) {
return lhs.constant().location() == rhs.constant().location() && return lhs.constant_.object().location() ==
rhs.constant_.object().location() &&
lhs.feedback() == rhs.feedback() && lhs.length() == rhs.length() && lhs.feedback() == rhs.feedback() && lhs.length() == rhs.length() &&
lhs.flags() == rhs.flags(); lhs.flags() == rhs.flags();
} }
...@@ -586,14 +584,15 @@ bool operator!=(CreateLiteralParameters const& lhs, ...@@ -586,14 +584,15 @@ bool operator!=(CreateLiteralParameters const& lhs,
size_t hash_value(CreateLiteralParameters const& p) { size_t hash_value(CreateLiteralParameters const& p) {
return base::hash_combine(p.constant().location(), return base::hash_combine(p.constant_.object().location(),
FeedbackSource::Hash()(p.feedback()), p.length(), FeedbackSource::Hash()(p.feedback()), p.length(),
p.flags()); p.flags());
} }
std::ostream& operator<<(std::ostream& os, CreateLiteralParameters const& p) { std::ostream& operator<<(std::ostream& os, CreateLiteralParameters const& p) {
return os << Brief(*p.constant()) << ", " << p.length() << ", " << p.flags(); return os << Brief(*p.constant_.object()) << ", " << p.length() << ", "
<< p.flags();
} }
...@@ -993,7 +992,7 @@ const Operator* JSOperatorBuilder::ConstructWithSpread( ...@@ -993,7 +992,7 @@ const Operator* JSOperatorBuilder::ConstructWithSpread(
parameters); // parameter parameters); // parameter
} }
const Operator* JSOperatorBuilder::LoadNamed(Handle<Name> name, const Operator* JSOperatorBuilder::LoadNamed(const NameRef& name,
const FeedbackSource& feedback) { const FeedbackSource& feedback) {
static constexpr int kObject = 1; static constexpr int kObject = 1;
static constexpr int kFeedbackVector = 1; static constexpr int kFeedbackVector = 1;
...@@ -1007,7 +1006,7 @@ const Operator* JSOperatorBuilder::LoadNamed(Handle<Name> name, ...@@ -1007,7 +1006,7 @@ const Operator* JSOperatorBuilder::LoadNamed(Handle<Name> name,
} }
const Operator* JSOperatorBuilder::LoadNamedFromSuper( const Operator* JSOperatorBuilder::LoadNamedFromSuper(
Handle<Name> name, const FeedbackSource& feedback) { const NameRef& name, const FeedbackSource& feedback) {
static constexpr int kReceiver = 1; static constexpr int kReceiver = 1;
static constexpr int kHomeObject = 1; static constexpr int kHomeObject = 1;
static constexpr int kFeedbackVector = 1; static constexpr int kFeedbackVector = 1;
...@@ -1100,7 +1099,7 @@ int RestoreRegisterIndexOf(const Operator* op) { ...@@ -1100,7 +1099,7 @@ int RestoreRegisterIndexOf(const Operator* op) {
} }
const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode, const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode,
Handle<Name> name, const NameRef& name,
FeedbackSource const& feedback) { FeedbackSource const& feedback) {
static constexpr int kObject = 1; static constexpr int kObject = 1;
static constexpr int kValue = 1; static constexpr int kValue = 1;
...@@ -1125,7 +1124,7 @@ const Operator* JSOperatorBuilder::StoreProperty( ...@@ -1125,7 +1124,7 @@ const Operator* JSOperatorBuilder::StoreProperty(
} }
const Operator* JSOperatorBuilder::StoreNamedOwn( const Operator* JSOperatorBuilder::StoreNamedOwn(
Handle<Name> name, FeedbackSource const& feedback) { const NameRef& name, FeedbackSource const& feedback) {
static constexpr int kObject = 1; static constexpr int kObject = 1;
static constexpr int kValue = 1; static constexpr int kValue = 1;
static constexpr int kFeedbackVector = 1; static constexpr int kFeedbackVector = 1;
...@@ -1152,7 +1151,7 @@ const Operator* JSOperatorBuilder::CreateGeneratorObject() { ...@@ -1152,7 +1151,7 @@ const Operator* JSOperatorBuilder::CreateGeneratorObject() {
2, 1, 1, 1, 1, 0); // counts 2, 1, 1, 1, 1, 0); // counts
} }
const Operator* JSOperatorBuilder::LoadGlobal(const Handle<Name>& name, const Operator* JSOperatorBuilder::LoadGlobal(const NameRef& name,
const FeedbackSource& feedback, const FeedbackSource& feedback,
TypeofMode typeof_mode) { TypeofMode typeof_mode) {
static constexpr int kFeedbackVector = 1; static constexpr int kFeedbackVector = 1;
...@@ -1166,7 +1165,7 @@ const Operator* JSOperatorBuilder::LoadGlobal(const Handle<Name>& name, ...@@ -1166,7 +1165,7 @@ const Operator* JSOperatorBuilder::LoadGlobal(const Handle<Name>& name,
} }
const Operator* JSOperatorBuilder::StoreGlobal(LanguageMode language_mode, const Operator* JSOperatorBuilder::StoreGlobal(LanguageMode language_mode,
const Handle<Name>& name, const NameRef& name,
const FeedbackSource& feedback) { const FeedbackSource& feedback) {
static constexpr int kValue = 1; static constexpr int kValue = 1;
static constexpr int kFeedbackVector = 1; static constexpr int kFeedbackVector = 1;
...@@ -1285,7 +1284,7 @@ const Operator* JSOperatorBuilder::CreateCollectionIterator( ...@@ -1285,7 +1284,7 @@ const Operator* JSOperatorBuilder::CreateCollectionIterator(
} }
const Operator* JSOperatorBuilder::CreateBoundFunction(size_t arity, const Operator* JSOperatorBuilder::CreateBoundFunction(size_t arity,
Handle<Map> map) { const MapRef& map) {
// bound_target_function, bound_this, arg1, ..., argN // bound_target_function, bound_this, arg1, ..., argN
int const value_input_count = static_cast<int>(arity) + 2; int const value_input_count = static_cast<int>(arity) + 2;
CreateBoundFunctionParameters parameters(arity, map); CreateBoundFunctionParameters parameters(arity, map);
...@@ -1297,7 +1296,7 @@ const Operator* JSOperatorBuilder::CreateBoundFunction(size_t arity, ...@@ -1297,7 +1296,7 @@ const Operator* JSOperatorBuilder::CreateBoundFunction(size_t arity,
} }
const Operator* JSOperatorBuilder::CreateClosure( const Operator* JSOperatorBuilder::CreateClosure(
Handle<SharedFunctionInfo> shared_info, Handle<CodeT> code, const SharedFunctionInfoRef& shared_info, const CodeTRef& code,
AllocationType allocation) { AllocationType allocation) {
static constexpr int kFeedbackCell = 1; static constexpr int kFeedbackCell = 1;
static constexpr int kArity = kFeedbackCell; static constexpr int kArity = kFeedbackCell;
...@@ -1310,7 +1309,7 @@ const Operator* JSOperatorBuilder::CreateClosure( ...@@ -1310,7 +1309,7 @@ const Operator* JSOperatorBuilder::CreateClosure(
} }
const Operator* JSOperatorBuilder::CreateLiteralArray( const Operator* JSOperatorBuilder::CreateLiteralArray(
Handle<ArrayBoilerplateDescription> description, const ArrayBoilerplateDescriptionRef& description,
FeedbackSource const& feedback, int literal_flags, int number_of_elements) { FeedbackSource const& feedback, int literal_flags, int number_of_elements) {
CreateLiteralParameters parameters(description, feedback, number_of_elements, CreateLiteralParameters parameters(description, feedback, number_of_elements,
literal_flags); literal_flags);
...@@ -1344,7 +1343,7 @@ const Operator* JSOperatorBuilder::CreateArrayFromIterable() { ...@@ -1344,7 +1343,7 @@ const Operator* JSOperatorBuilder::CreateArrayFromIterable() {
} }
const Operator* JSOperatorBuilder::CreateLiteralObject( const Operator* JSOperatorBuilder::CreateLiteralObject(
Handle<ObjectBoilerplateDescription> constant_properties, const ObjectBoilerplateDescriptionRef& constant_properties,
FeedbackSource const& feedback, int literal_flags, FeedbackSource const& feedback, int literal_flags,
int number_of_properties) { int number_of_properties) {
CreateLiteralParameters parameters(constant_properties, feedback, CreateLiteralParameters parameters(constant_properties, feedback,
...@@ -1358,8 +1357,8 @@ const Operator* JSOperatorBuilder::CreateLiteralObject( ...@@ -1358,8 +1357,8 @@ const Operator* JSOperatorBuilder::CreateLiteralObject(
} }
const Operator* JSOperatorBuilder::GetTemplateObject( const Operator* JSOperatorBuilder::GetTemplateObject(
Handle<TemplateObjectDescription> description, const TemplateObjectDescriptionRef& description,
Handle<SharedFunctionInfo> shared, FeedbackSource const& feedback) { const SharedFunctionInfoRef& shared, FeedbackSource const& feedback) {
GetTemplateObjectParameters parameters(description, shared, feedback); GetTemplateObjectParameters parameters(description, shared, feedback);
return zone()->New<Operator1<GetTemplateObjectParameters>>( // -- return zone()->New<Operator1<GetTemplateObjectParameters>>( // --
IrOpcode::kJSGetTemplateObject, // opcode IrOpcode::kJSGetTemplateObject, // opcode
...@@ -1398,7 +1397,7 @@ const Operator* JSOperatorBuilder::CreateEmptyLiteralObject() { ...@@ -1398,7 +1397,7 @@ const Operator* JSOperatorBuilder::CreateEmptyLiteralObject() {
} }
const Operator* JSOperatorBuilder::CreateLiteralRegExp( const Operator* JSOperatorBuilder::CreateLiteralRegExp(
Handle<String> constant_pattern, FeedbackSource const& feedback, const StringRef& constant_pattern, FeedbackSource const& feedback,
int literal_flags) { int literal_flags) {
CreateLiteralParameters parameters(constant_pattern, feedback, -1, CreateLiteralParameters parameters(constant_pattern, feedback, -1,
literal_flags); literal_flags);
...@@ -1411,7 +1410,7 @@ const Operator* JSOperatorBuilder::CreateLiteralRegExp( ...@@ -1411,7 +1410,7 @@ const Operator* JSOperatorBuilder::CreateLiteralRegExp(
} }
const Operator* JSOperatorBuilder::CreateFunctionContext( const Operator* JSOperatorBuilder::CreateFunctionContext(
Handle<ScopeInfo> scope_info, int slot_count, ScopeType scope_type) { const ScopeInfoRef& scope_info, int slot_count, ScopeType scope_type) {
CreateFunctionContextParameters parameters(scope_info, slot_count, CreateFunctionContextParameters parameters(scope_info, slot_count,
scope_type); scope_type);
return zone()->New<Operator1<CreateFunctionContextParameters>>( // -- return zone()->New<Operator1<CreateFunctionContextParameters>>( // --
...@@ -1422,37 +1421,53 @@ const Operator* JSOperatorBuilder::CreateFunctionContext( ...@@ -1422,37 +1421,53 @@ const Operator* JSOperatorBuilder::CreateFunctionContext(
} }
const Operator* JSOperatorBuilder::CreateCatchContext( const Operator* JSOperatorBuilder::CreateCatchContext(
const Handle<ScopeInfo>& scope_info) { const ScopeInfoRef& scope_info) {
return zone()->New<Operator1<Handle<ScopeInfo>>>( return zone()->New<Operator1<ScopeInfoTinyRef>>(
IrOpcode::kJSCreateCatchContext, Operator::kNoProperties, // opcode IrOpcode::kJSCreateCatchContext, Operator::kNoProperties, // opcode
"JSCreateCatchContext", // name "JSCreateCatchContext", // name
1, 1, 1, 1, 1, 2, // counts 1, 1, 1, 1, 1, 2, // counts
scope_info); // parameter ScopeInfoTinyRef{scope_info}); // parameter
} }
const Operator* JSOperatorBuilder::CreateWithContext( const Operator* JSOperatorBuilder::CreateWithContext(
const Handle<ScopeInfo>& scope_info) { const ScopeInfoRef& scope_info) {
return zone()->New<Operator1<Handle<ScopeInfo>>>( return zone()->New<Operator1<ScopeInfoTinyRef>>(
IrOpcode::kJSCreateWithContext, Operator::kNoProperties, // opcode IrOpcode::kJSCreateWithContext, Operator::kNoProperties, // opcode
"JSCreateWithContext", // name "JSCreateWithContext", // name
1, 1, 1, 1, 1, 2, // counts 1, 1, 1, 1, 1, 2, // counts
scope_info); // parameter ScopeInfoTinyRef{scope_info}); // parameter
} }
const Operator* JSOperatorBuilder::CreateBlockContext( const Operator* JSOperatorBuilder::CreateBlockContext(
const Handle<ScopeInfo>& scope_info) { const ScopeInfoRef& scope_info) {
return zone()->New<Operator1<Handle<ScopeInfo>>>( // -- return zone()->New<Operator1<ScopeInfoTinyRef>>( // --
IrOpcode::kJSCreateBlockContext, Operator::kNoProperties, // opcode IrOpcode::kJSCreateBlockContext, Operator::kNoProperties, // opcode
"JSCreateBlockContext", // name "JSCreateBlockContext", // name
0, 1, 1, 1, 1, 2, // counts 0, 1, 1, 1, 1, 2, // counts
scope_info); // parameter ScopeInfoTinyRef{scope_info}); // parameter
} }
Handle<ScopeInfo> ScopeInfoOf(const Operator* op) { ScopeInfoRef ScopeInfoOf(JSHeapBroker* broker, const Operator* op) {
DCHECK(IrOpcode::kJSCreateBlockContext == op->opcode() || DCHECK(IrOpcode::kJSCreateBlockContext == op->opcode() ||
IrOpcode::kJSCreateWithContext == op->opcode() || IrOpcode::kJSCreateWithContext == op->opcode() ||
IrOpcode::kJSCreateCatchContext == op->opcode()); IrOpcode::kJSCreateCatchContext == op->opcode());
return OpParameter<Handle<ScopeInfo>>(op); return OpParameter<ScopeInfoTinyRef>(op).AsRef(broker);
}
bool operator==(ScopeInfoTinyRef const& lhs, ScopeInfoTinyRef const& rhs) {
return lhs.object().location() == rhs.object().location();
}
bool operator!=(ScopeInfoTinyRef const& lhs, ScopeInfoTinyRef const& rhs) {
return !(lhs == rhs);
}
size_t hash_value(ScopeInfoTinyRef const& ref) {
return reinterpret_cast<size_t>(ref.object().location());
}
std::ostream& operator<<(std::ostream& os, ScopeInfoTinyRef const& ref) {
return os << Brief(*ref.object());
} }
#undef CACHED_OP_LIST #undef CACHED_OP_LIST
......
...@@ -363,28 +363,33 @@ V8_EXPORT_PRIVATE ContextAccess const& ContextAccessOf(Operator const*); ...@@ -363,28 +363,33 @@ V8_EXPORT_PRIVATE ContextAccess const& ContextAccessOf(Operator const*);
// is used as a parameter by the JSCreateFunctionContext operator. // is used as a parameter by the JSCreateFunctionContext operator.
class CreateFunctionContextParameters final { class CreateFunctionContextParameters final {
public: public:
CreateFunctionContextParameters(Handle<ScopeInfo> scope_info, int slot_count, CreateFunctionContextParameters(const ScopeInfoRef& scope_info,
ScopeType scope_type); int slot_count, ScopeType scope_type)
: scope_info_(scope_info),
slot_count_(slot_count),
scope_type_(scope_type) {}
Handle<ScopeInfo> scope_info() const { return scope_info_; } ScopeInfoRef scope_info(JSHeapBroker* broker) const {
return scope_info_.AsRef(broker);
}
int slot_count() const { return slot_count_; } int slot_count() const { return slot_count_; }
ScopeType scope_type() const { return scope_type_; } ScopeType scope_type() const { return scope_type_; }
private: private:
Handle<ScopeInfo> scope_info_; const ScopeInfoTinyRef scope_info_;
int const slot_count_; int const slot_count_;
ScopeType const scope_type_; ScopeType const scope_type_;
};
bool operator==(CreateFunctionContextParameters const& lhs, friend bool operator==(CreateFunctionContextParameters const& lhs,
CreateFunctionContextParameters const& rhs); CreateFunctionContextParameters const& rhs);
bool operator!=(CreateFunctionContextParameters const& lhs, friend bool operator!=(CreateFunctionContextParameters const& lhs,
CreateFunctionContextParameters const& rhs); CreateFunctionContextParameters const& rhs);
size_t hash_value(CreateFunctionContextParameters const& parameters); friend size_t hash_value(CreateFunctionContextParameters const& parameters);
std::ostream& operator<<(std::ostream& os, friend std::ostream& operator<<(
CreateFunctionContextParameters const& parameters); std::ostream& os, CreateFunctionContextParameters const& parameters);
};
CreateFunctionContextParameters const& CreateFunctionContextParametersOf( CreateFunctionContextParameters const& CreateFunctionContextParametersOf(
Operator const*); Operator const*);
...@@ -392,23 +397,24 @@ CreateFunctionContextParameters const& CreateFunctionContextParametersOf( ...@@ -392,23 +397,24 @@ CreateFunctionContextParameters const& CreateFunctionContextParametersOf(
// Defines parameters for JSStoreNamedOwn operator. // Defines parameters for JSStoreNamedOwn operator.
class StoreNamedOwnParameters final { class StoreNamedOwnParameters final {
public: public:
StoreNamedOwnParameters(Handle<Name> name, FeedbackSource const& feedback) StoreNamedOwnParameters(const NameRef& name, FeedbackSource const& feedback)
: name_(name), feedback_(feedback) {} : name_(name), feedback_(feedback) {}
Handle<Name> name() const { return name_; } NameRef name(JSHeapBroker* broker) const { return name_.AsRef(broker); }
FeedbackSource const& feedback() const { return feedback_; } FeedbackSource const& feedback() const { return feedback_; }
private: private:
Handle<Name> const name_; const NameTinyRef name_;
FeedbackSource const feedback_; FeedbackSource const feedback_;
};
bool operator==(StoreNamedOwnParameters const&, StoreNamedOwnParameters const&);
bool operator!=(StoreNamedOwnParameters const&, StoreNamedOwnParameters const&);
size_t hash_value(StoreNamedOwnParameters const&); friend bool operator==(StoreNamedOwnParameters const&,
StoreNamedOwnParameters const&);
std::ostream& operator<<(std::ostream&, StoreNamedOwnParameters const&); friend bool operator!=(StoreNamedOwnParameters const&,
StoreNamedOwnParameters const&);
friend size_t hash_value(StoreNamedOwnParameters const&);
friend std::ostream& operator<<(std::ostream&,
StoreNamedOwnParameters const&);
};
const StoreNamedOwnParameters& StoreNamedOwnParametersOf(const Operator* op); const StoreNamedOwnParameters& StoreNamedOwnParametersOf(const Operator* op);
...@@ -439,26 +445,26 @@ const FeedbackParameter& FeedbackParameterOf(const Operator* op); ...@@ -439,26 +445,26 @@ const FeedbackParameter& FeedbackParameterOf(const Operator* op);
// used as a parameter by the JSLoadNamed and JSStoreNamed operators. // used as a parameter by the JSLoadNamed and JSStoreNamed operators.
class NamedAccess final { class NamedAccess final {
public: public:
NamedAccess(LanguageMode language_mode, Handle<Name> name, NamedAccess(LanguageMode language_mode, const NameRef& name,
FeedbackSource const& feedback) FeedbackSource const& feedback)
: name_(name), feedback_(feedback), language_mode_(language_mode) {} : name_(name), feedback_(feedback), language_mode_(language_mode) {}
Handle<Name> name() const { return name_; } NameRef name(JSHeapBroker* broker) const { return name_.AsRef(broker); }
LanguageMode language_mode() const { return language_mode_; } LanguageMode language_mode() const { return language_mode_; }
FeedbackSource const& feedback() const { return feedback_; } FeedbackSource const& feedback() const { return feedback_; }
private: private:
Handle<Name> const name_; const NameTinyRef name_;
FeedbackSource const feedback_; FeedbackSource const feedback_;
LanguageMode const language_mode_; LanguageMode const language_mode_;
};
bool operator==(NamedAccess const&, NamedAccess const&); friend bool operator==(NamedAccess const&, NamedAccess const&);
bool operator!=(NamedAccess const&, NamedAccess const&); friend bool operator!=(NamedAccess const&, NamedAccess const&);
size_t hash_value(NamedAccess const&); friend size_t hash_value(NamedAccess const&);
std::ostream& operator<<(std::ostream&, NamedAccess const&); friend std::ostream& operator<<(std::ostream&, NamedAccess const&);
};
const NamedAccess& NamedAccessOf(const Operator* op); const NamedAccess& NamedAccessOf(const Operator* op);
...@@ -467,27 +473,29 @@ const NamedAccess& NamedAccessOf(const Operator* op); ...@@ -467,27 +473,29 @@ const NamedAccess& NamedAccessOf(const Operator* op);
// used as a parameter by JSLoadGlobal operator. // used as a parameter by JSLoadGlobal operator.
class LoadGlobalParameters final { class LoadGlobalParameters final {
public: public:
LoadGlobalParameters(const Handle<Name>& name, const FeedbackSource& feedback, LoadGlobalParameters(const NameRef& name, const FeedbackSource& feedback,
TypeofMode typeof_mode) TypeofMode typeof_mode)
: name_(name), feedback_(feedback), typeof_mode_(typeof_mode) {} : name_(name), feedback_(feedback), typeof_mode_(typeof_mode) {}
const Handle<Name>& name() const { return name_; } NameRef name(JSHeapBroker* broker) const { return name_.AsRef(broker); }
TypeofMode typeof_mode() const { return typeof_mode_; } TypeofMode typeof_mode() const { return typeof_mode_; }
const FeedbackSource& feedback() const { return feedback_; } const FeedbackSource& feedback() const { return feedback_; }
private: private:
const Handle<Name> name_; const NameTinyRef name_;
const FeedbackSource feedback_; const FeedbackSource feedback_;
const TypeofMode typeof_mode_; const TypeofMode typeof_mode_;
};
bool operator==(LoadGlobalParameters const&, LoadGlobalParameters const&); friend bool operator==(LoadGlobalParameters const&,
bool operator!=(LoadGlobalParameters const&, LoadGlobalParameters const&); LoadGlobalParameters const&);
friend bool operator!=(LoadGlobalParameters const&,
LoadGlobalParameters const&);
size_t hash_value(LoadGlobalParameters const&); friend size_t hash_value(LoadGlobalParameters const&);
std::ostream& operator<<(std::ostream&, LoadGlobalParameters const&); friend std::ostream& operator<<(std::ostream&, LoadGlobalParameters const&);
};
const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op); const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op);
...@@ -497,26 +505,27 @@ const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op); ...@@ -497,26 +505,27 @@ const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op);
class StoreGlobalParameters final { class StoreGlobalParameters final {
public: public:
StoreGlobalParameters(LanguageMode language_mode, StoreGlobalParameters(LanguageMode language_mode,
const FeedbackSource& feedback, const FeedbackSource& feedback, const NameRef& name)
const Handle<Name>& name)
: language_mode_(language_mode), name_(name), feedback_(feedback) {} : language_mode_(language_mode), name_(name), feedback_(feedback) {}
LanguageMode language_mode() const { return language_mode_; } LanguageMode language_mode() const { return language_mode_; }
FeedbackSource const& feedback() const { return feedback_; } FeedbackSource const& feedback() const { return feedback_; }
Handle<Name> const& name() const { return name_; } NameRef name(JSHeapBroker* broker) const { return name_.AsRef(broker); }
private: private:
LanguageMode const language_mode_; LanguageMode const language_mode_;
Handle<Name> const name_; const NameTinyRef name_;
FeedbackSource const feedback_; FeedbackSource const feedback_;
};
bool operator==(StoreGlobalParameters const&, StoreGlobalParameters const&); friend bool operator==(StoreGlobalParameters const&,
bool operator!=(StoreGlobalParameters const&, StoreGlobalParameters const&); StoreGlobalParameters const&);
friend bool operator!=(StoreGlobalParameters const&,
StoreGlobalParameters const&);
size_t hash_value(StoreGlobalParameters const&); friend size_t hash_value(StoreGlobalParameters const&);
std::ostream& operator<<(std::ostream&, StoreGlobalParameters const&); friend std::ostream& operator<<(std::ostream&, StoreGlobalParameters const&);
};
const StoreGlobalParameters& StoreGlobalParametersOf(const Operator* op); const StoreGlobalParameters& StoreGlobalParametersOf(const Operator* op);
...@@ -637,25 +646,26 @@ const CreateCollectionIteratorParameters& CreateCollectionIteratorParametersOf( ...@@ -637,25 +646,26 @@ const CreateCollectionIteratorParameters& CreateCollectionIteratorParametersOf(
// This is used as parameter by JSCreateBoundFunction operators. // This is used as parameter by JSCreateBoundFunction operators.
class CreateBoundFunctionParameters final { class CreateBoundFunctionParameters final {
public: public:
CreateBoundFunctionParameters(size_t arity, Handle<Map> map) CreateBoundFunctionParameters(size_t arity, const MapRef& map)
: arity_(arity), map_(map) {} : arity_(arity), map_(map) {}
size_t arity() const { return arity_; } size_t arity() const { return arity_; }
Handle<Map> map() const { return map_; } MapRef map(JSHeapBroker* broker) const { return map_.AsRef(broker); }
private: private:
size_t const arity_; size_t const arity_;
Handle<Map> const map_; const MapTinyRef map_;
};
bool operator==(CreateBoundFunctionParameters const&, friend bool operator==(CreateBoundFunctionParameters const&,
CreateBoundFunctionParameters const&); CreateBoundFunctionParameters const&);
bool operator!=(CreateBoundFunctionParameters const&, friend bool operator!=(CreateBoundFunctionParameters const&,
CreateBoundFunctionParameters const&); CreateBoundFunctionParameters const&);
size_t hash_value(CreateBoundFunctionParameters const&); friend size_t hash_value(CreateBoundFunctionParameters const&);
std::ostream& operator<<(std::ostream&, CreateBoundFunctionParameters const&); friend std::ostream& operator<<(std::ostream&,
CreateBoundFunctionParameters const&);
};
const CreateBoundFunctionParameters& CreateBoundFunctionParametersOf( const CreateBoundFunctionParameters& CreateBoundFunctionParametersOf(
const Operator* op); const Operator* op);
...@@ -664,54 +674,64 @@ const CreateBoundFunctionParameters& CreateBoundFunctionParametersOf( ...@@ -664,54 +674,64 @@ const CreateBoundFunctionParameters& CreateBoundFunctionParametersOf(
// used as a parameter by JSCreateClosure operators. // used as a parameter by JSCreateClosure operators.
class CreateClosureParameters final { class CreateClosureParameters final {
public: public:
CreateClosureParameters(Handle<SharedFunctionInfo> shared_info, CreateClosureParameters(const SharedFunctionInfoRef& shared_info,
Handle<CodeT> code, AllocationType allocation) const CodeTRef& code, AllocationType allocation)
: shared_info_(shared_info), code_(code), allocation_(allocation) {} : shared_info_(shared_info), code_(code), allocation_(allocation) {}
Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } SharedFunctionInfoRef shared_info(JSHeapBroker* broker) const {
Handle<CodeT> code() const { return code_; } return shared_info_.AsRef(broker);
}
CodeTRef code(JSHeapBroker* broker) const { return code_.AsRef(broker); }
AllocationType allocation() const { return allocation_; } AllocationType allocation() const { return allocation_; }
private: private:
Handle<SharedFunctionInfo> const shared_info_; const SharedFunctionInfoTinyRef shared_info_;
Handle<CodeT> const code_; const CodeTTinyRef code_;
AllocationType const allocation_; AllocationType const allocation_;
};
bool operator==(CreateClosureParameters const&, CreateClosureParameters const&); friend bool operator==(CreateClosureParameters const&,
bool operator!=(CreateClosureParameters const&, CreateClosureParameters const&); CreateClosureParameters const&);
friend bool operator!=(CreateClosureParameters const&,
CreateClosureParameters const&);
size_t hash_value(CreateClosureParameters const&); friend size_t hash_value(CreateClosureParameters const&);
std::ostream& operator<<(std::ostream&, CreateClosureParameters const&); friend std::ostream& operator<<(std::ostream&,
CreateClosureParameters const&);
};
const CreateClosureParameters& CreateClosureParametersOf(const Operator* op); const CreateClosureParameters& CreateClosureParametersOf(const Operator* op);
class GetTemplateObjectParameters final { class GetTemplateObjectParameters final {
public: public:
GetTemplateObjectParameters(Handle<TemplateObjectDescription> description, GetTemplateObjectParameters(const TemplateObjectDescriptionRef& description,
Handle<SharedFunctionInfo> shared, const SharedFunctionInfoRef& shared,
FeedbackSource const& feedback) FeedbackSource const& feedback)
: description_(description), shared_(shared), feedback_(feedback) {} : description_(description), shared_(shared), feedback_(feedback) {}
Handle<TemplateObjectDescription> description() const { return description_; } TemplateObjectDescriptionRef description(JSHeapBroker* broker) const {
Handle<SharedFunctionInfo> shared() const { return shared_; } return description_.AsRef(broker);
}
SharedFunctionInfoRef shared(JSHeapBroker* broker) const {
return shared_.AsRef(broker);
}
FeedbackSource const& feedback() const { return feedback_; } FeedbackSource const& feedback() const { return feedback_; }
private: private:
Handle<TemplateObjectDescription> const description_; const TemplateObjectDescriptionTinyRef description_;
Handle<SharedFunctionInfo> const shared_; const SharedFunctionInfoTinyRef shared_;
FeedbackSource const feedback_; FeedbackSource const feedback_;
};
bool operator==(GetTemplateObjectParameters const&, friend bool operator==(GetTemplateObjectParameters const&,
GetTemplateObjectParameters const&); GetTemplateObjectParameters const&);
bool operator!=(GetTemplateObjectParameters const&, friend bool operator!=(GetTemplateObjectParameters const&,
GetTemplateObjectParameters const&); GetTemplateObjectParameters const&);
size_t hash_value(GetTemplateObjectParameters const&); friend size_t hash_value(GetTemplateObjectParameters const&);
std::ostream& operator<<(std::ostream&, GetTemplateObjectParameters const&); friend std::ostream& operator<<(std::ostream&,
GetTemplateObjectParameters const&);
};
const GetTemplateObjectParameters& GetTemplateObjectParametersOf( const GetTemplateObjectParameters& GetTemplateObjectParametersOf(
const Operator* op); const Operator* op);
...@@ -721,31 +741,36 @@ const GetTemplateObjectParameters& GetTemplateObjectParametersOf( ...@@ -721,31 +741,36 @@ const GetTemplateObjectParameters& GetTemplateObjectParametersOf(
// JSCreateLiteralRegExp operators. // JSCreateLiteralRegExp operators.
class CreateLiteralParameters final { class CreateLiteralParameters final {
public: public:
CreateLiteralParameters(Handle<HeapObject> constant, CreateLiteralParameters(const HeapObjectRef& constant,
FeedbackSource const& feedback, int length, int flags) FeedbackSource const& feedback, int length, int flags)
: constant_(constant), : constant_(constant),
feedback_(feedback), feedback_(feedback),
length_(length), length_(length),
flags_(flags) {} flags_(flags) {}
Handle<HeapObject> constant() const { return constant_; } HeapObjectRef constant(JSHeapBroker* broker) const {
return constant_.AsRef(broker);
}
FeedbackSource const& feedback() const { return feedback_; } FeedbackSource const& feedback() const { return feedback_; }
int length() const { return length_; } int length() const { return length_; }
int flags() const { return flags_; } int flags() const { return flags_; }
private: private:
Handle<HeapObject> const constant_; const HeapObjectTinyRef constant_;
FeedbackSource const feedback_; FeedbackSource const feedback_;
int const length_; int const length_;
int const flags_; int const flags_;
};
bool operator==(CreateLiteralParameters const&, CreateLiteralParameters const&); friend bool operator==(CreateLiteralParameters const&,
bool operator!=(CreateLiteralParameters const&, CreateLiteralParameters const&); CreateLiteralParameters const&);
friend bool operator!=(CreateLiteralParameters const&,
CreateLiteralParameters const&);
size_t hash_value(CreateLiteralParameters const&); friend size_t hash_value(CreateLiteralParameters const&);
std::ostream& operator<<(std::ostream&, CreateLiteralParameters const&); friend std::ostream& operator<<(std::ostream&,
CreateLiteralParameters const&);
};
const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op); const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op);
...@@ -859,7 +884,16 @@ int RegisterCountOf(Operator const* op) V8_WARN_UNUSED_RESULT; ...@@ -859,7 +884,16 @@ int RegisterCountOf(Operator const* op) V8_WARN_UNUSED_RESULT;
int GeneratorStoreValueCountOf(const Operator* op) V8_WARN_UNUSED_RESULT; int GeneratorStoreValueCountOf(const Operator* op) V8_WARN_UNUSED_RESULT;
int RestoreRegisterIndexOf(const Operator* op) V8_WARN_UNUSED_RESULT; int RestoreRegisterIndexOf(const Operator* op) V8_WARN_UNUSED_RESULT;
Handle<ScopeInfo> ScopeInfoOf(const Operator* op) V8_WARN_UNUSED_RESULT; ScopeInfoRef ScopeInfoOf(JSHeapBroker* broker,
const Operator* op) V8_WARN_UNUSED_RESULT;
bool operator==(ScopeInfoTinyRef const&, ScopeInfoTinyRef const&);
bool operator!=(ScopeInfoTinyRef const&, ScopeInfoTinyRef const&);
size_t hash_value(ScopeInfoTinyRef const&);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
ScopeInfoTinyRef const&);
// Interface for building JavaScript-level operators, e.g. directly from the // Interface for building JavaScript-level operators, e.g. directly from the
// AST. Most operators have no parameters, thus can be globally shared for all // AST. Most operators have no parameters, thus can be globally shared for all
...@@ -911,9 +945,9 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final ...@@ -911,9 +945,9 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
const Operator* CreateArrayIterator(IterationKind); const Operator* CreateArrayIterator(IterationKind);
const Operator* CreateAsyncFunctionObject(int register_count); const Operator* CreateAsyncFunctionObject(int register_count);
const Operator* CreateCollectionIterator(CollectionKind, IterationKind); const Operator* CreateCollectionIterator(CollectionKind, IterationKind);
const Operator* CreateBoundFunction(size_t arity, Handle<Map> map); const Operator* CreateBoundFunction(size_t arity, const MapRef& map);
const Operator* CreateClosure( const Operator* CreateClosure(
Handle<SharedFunctionInfo> shared_info, Handle<CodeT> code, const SharedFunctionInfoRef& shared_info, const CodeTRef& code,
AllocationType allocation = AllocationType::kYoung); AllocationType allocation = AllocationType::kYoung);
const Operator* CreateIterResultObject(); const Operator* CreateIterResultObject();
const Operator* CreateStringIterator(); const Operator* CreateStringIterator();
...@@ -922,25 +956,25 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final ...@@ -922,25 +956,25 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
const Operator* CreatePromise(); const Operator* CreatePromise();
const Operator* CreateTypedArray(); const Operator* CreateTypedArray();
const Operator* CreateLiteralArray( const Operator* CreateLiteralArray(
Handle<ArrayBoilerplateDescription> constant, const ArrayBoilerplateDescriptionRef& constant,
FeedbackSource const& feedback, int literal_flags, FeedbackSource const& feedback, int literal_flags,
int number_of_elements); int number_of_elements);
const Operator* CreateEmptyLiteralArray(FeedbackSource const& feedback); const Operator* CreateEmptyLiteralArray(FeedbackSource const& feedback);
const Operator* CreateArrayFromIterable(); const Operator* CreateArrayFromIterable();
const Operator* CreateEmptyLiteralObject(); const Operator* CreateEmptyLiteralObject();
const Operator* CreateLiteralObject( const Operator* CreateLiteralObject(
Handle<ObjectBoilerplateDescription> constant, const ObjectBoilerplateDescriptionRef& constant,
FeedbackSource const& feedback, int literal_flags, FeedbackSource const& feedback, int literal_flags,
int number_of_properties); int number_of_properties);
const Operator* CloneObject(FeedbackSource const& feedback, const Operator* CloneObject(FeedbackSource const& feedback,
int literal_flags); int literal_flags);
const Operator* CreateLiteralRegExp(Handle<String> constant_pattern, const Operator* CreateLiteralRegExp(const StringRef& constant_pattern,
FeedbackSource const& feedback, FeedbackSource const& feedback,
int literal_flags); int literal_flags);
const Operator* GetTemplateObject( const Operator* GetTemplateObject(
Handle<TemplateObjectDescription> description, const TemplateObjectDescriptionRef& description,
Handle<SharedFunctionInfo> shared, FeedbackSource const& feedback); const SharedFunctionInfoRef& shared, FeedbackSource const& feedback);
const Operator* CallForwardVarargs(size_t arity, uint32_t start_index); const Operator* CallForwardVarargs(size_t arity, uint32_t start_index);
const Operator* Call( const Operator* Call(
...@@ -981,16 +1015,17 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final ...@@ -981,16 +1015,17 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
FeedbackSource const& feedback = FeedbackSource()); FeedbackSource const& feedback = FeedbackSource());
const Operator* LoadProperty(FeedbackSource const& feedback); const Operator* LoadProperty(FeedbackSource const& feedback);
const Operator* LoadNamed(Handle<Name> name, FeedbackSource const& feedback); const Operator* LoadNamed(const NameRef& name,
const Operator* LoadNamedFromSuper(Handle<Name> name, FeedbackSource const& feedback);
const Operator* LoadNamedFromSuper(const NameRef& name,
FeedbackSource const& feedback); FeedbackSource const& feedback);
const Operator* StoreProperty(LanguageMode language_mode, const Operator* StoreProperty(LanguageMode language_mode,
FeedbackSource const& feedback); FeedbackSource const& feedback);
const Operator* StoreNamed(LanguageMode language_mode, Handle<Name> name, const Operator* StoreNamed(LanguageMode language_mode, const NameRef& name,
FeedbackSource const& feedback); FeedbackSource const& feedback);
const Operator* StoreNamedOwn(Handle<Name> name, const Operator* StoreNamedOwn(const NameRef& name,
FeedbackSource const& feedback); FeedbackSource const& feedback);
const Operator* StoreDataPropertyInLiteral(const FeedbackSource& feedback); const Operator* StoreDataPropertyInLiteral(const FeedbackSource& feedback);
const Operator* StoreInArrayLiteral(const FeedbackSource& feedback); const Operator* StoreInArrayLiteral(const FeedbackSource& feedback);
...@@ -1003,11 +1038,10 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final ...@@ -1003,11 +1038,10 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
const Operator* CreateGeneratorObject(); const Operator* CreateGeneratorObject();
const Operator* LoadGlobal(const Handle<Name>& name, const Operator* LoadGlobal(const NameRef& name,
const FeedbackSource& feedback, const FeedbackSource& feedback,
TypeofMode typeof_mode = TypeofMode::kNotInside); TypeofMode typeof_mode = TypeofMode::kNotInside);
const Operator* StoreGlobal(LanguageMode language_mode, const Operator* StoreGlobal(LanguageMode language_mode, const NameRef& name,
const Handle<Name>& name,
const FeedbackSource& feedback); const FeedbackSource& feedback);
const Operator* HasContextExtension(size_t depth); const Operator* HasContextExtension(size_t depth);
...@@ -1054,11 +1088,11 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final ...@@ -1054,11 +1088,11 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
const Operator* RejectPromise(); const Operator* RejectPromise();
const Operator* ResolvePromise(); const Operator* ResolvePromise();
const Operator* CreateFunctionContext(Handle<ScopeInfo> scope_info, const Operator* CreateFunctionContext(const ScopeInfoRef& scope_info,
int slot_count, ScopeType scope_type); int slot_count, ScopeType scope_type);
const Operator* CreateCatchContext(const Handle<ScopeInfo>& scope_info); const Operator* CreateCatchContext(const ScopeInfoRef& scope_info);
const Operator* CreateWithContext(const Handle<ScopeInfo>& scope_info); const Operator* CreateWithContext(const ScopeInfoRef& scope_info);
const Operator* CreateBlockContext(const Handle<ScopeInfo>& scpope_info); const Operator* CreateBlockContext(const ScopeInfoRef& scpope_info);
const Operator* ObjectIsArray(); const Operator* ObjectIsArray();
const Operator* ParseInt(); const Operator* ParseInt();
......
...@@ -1173,7 +1173,7 @@ Reduction JSTypedLowering::ReduceJSLoadNamed(Node* node) { ...@@ -1173,7 +1173,7 @@ Reduction JSTypedLowering::ReduceJSLoadNamed(Node* node) {
JSLoadNamedNode n(node); JSLoadNamedNode n(node);
Node* receiver = n.object(); Node* receiver = n.object();
Type receiver_type = NodeProperties::GetType(receiver); Type receiver_type = NodeProperties::GetType(receiver);
NameRef name = MakeRef(broker(), NamedAccessOf(node->op()).name()); NameRef name = NamedAccessOf(node->op()).name(broker());
NameRef length_str = MakeRef(broker(), factory()->length_string()); NameRef length_str = MakeRef(broker(), factory()->length_string());
// Optimize "length" property of strings. // Optimize "length" property of strings.
if (name.equals(length_str) && receiver_type.Is(Type::String())) { if (name.equals(length_str) && receiver_type.Is(Type::String())) {
...@@ -1705,7 +1705,7 @@ Reduction JSTypedLowering::ReduceJSCall(Node* node) { ...@@ -1705,7 +1705,7 @@ Reduction JSTypedLowering::ReduceJSCall(Node* node) {
} else if (target->opcode() == IrOpcode::kJSCreateClosure) { } else if (target->opcode() == IrOpcode::kJSCreateClosure) {
CreateClosureParameters const& ccp = CreateClosureParameters const& ccp =
JSCreateClosureNode{target}.Parameters(); JSCreateClosureNode{target}.Parameters();
shared = MakeRef(broker(), ccp.shared_info()); shared = ccp.shared_info(broker());
} else if (target->opcode() == IrOpcode::kCheckClosure) { } else if (target->opcode() == IrOpcode::kCheckClosure) {
FeedbackCellRef cell = MakeRef(broker(), FeedbackCellOf(target->op())); FeedbackCellRef cell = MakeRef(broker(), FeedbackCellOf(target->op()));
base::Optional<FeedbackVectorRef> feedback_vector = cell.value(); base::Optional<FeedbackVectorRef> feedback_vector = cell.value();
......
...@@ -201,7 +201,7 @@ TEST(ReduceJSLoadContext1) { ...@@ -201,7 +201,7 @@ TEST(ReduceJSLoadContext1) {
Node* start = t.graph()->NewNode(t.common()->Start(0)); Node* start = t.graph()->NewNode(t.common()->Start(0));
t.graph()->SetStart(start); t.graph()->SetStart(start);
Handle<ScopeInfo> empty(ScopeInfo::Empty(t.main_isolate()), t.main_isolate()); ScopeInfoRef empty = MakeRef(t.broker(), ScopeInfo::Empty(t.main_isolate()));
const i::compiler::Operator* create_function_context = const i::compiler::Operator* create_function_context =
t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE); t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE);
...@@ -271,7 +271,7 @@ TEST(ReduceJSLoadContext2) { ...@@ -271,7 +271,7 @@ TEST(ReduceJSLoadContext2) {
Node* start = t.graph()->NewNode(t.common()->Start(0)); Node* start = t.graph()->NewNode(t.common()->Start(0));
t.graph()->SetStart(start); t.graph()->SetStart(start);
Handle<ScopeInfo> empty(ScopeInfo::Empty(t.main_isolate()), t.main_isolate()); ScopeInfoRef empty = MakeRef(t.broker(), ScopeInfo::Empty(t.main_isolate()));
const i::compiler::Operator* create_function_context = const i::compiler::Operator* create_function_context =
t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE); t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE);
...@@ -365,8 +365,7 @@ TEST(ReduceJSLoadContext3) { ...@@ -365,8 +365,7 @@ TEST(ReduceJSLoadContext3) {
Node* start = t.graph()->NewNode(t.common()->Start(2)); Node* start = t.graph()->NewNode(t.common()->Start(2));
t.graph()->SetStart(start); t.graph()->SetStart(start);
Handle<ScopeInfo> empty(ScopeInfo::Empty(t.main_isolate()), ScopeInfoRef empty = MakeRef(t.broker(), ScopeInfo::Empty(t.main_isolate()));
handle_zone_scope.main_isolate());
const i::compiler::Operator* create_function_context = const i::compiler::Operator* create_function_context =
t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE); t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE);
...@@ -496,7 +495,7 @@ TEST(ReduceJSStoreContext1) { ...@@ -496,7 +495,7 @@ TEST(ReduceJSStoreContext1) {
Node* start = t.graph()->NewNode(t.common()->Start(0)); Node* start = t.graph()->NewNode(t.common()->Start(0));
t.graph()->SetStart(start); t.graph()->SetStart(start);
Handle<ScopeInfo> empty(ScopeInfo::Empty(t.main_isolate()), t.main_isolate()); ScopeInfoRef empty = MakeRef(t.broker(), ScopeInfo::Empty(t.main_isolate()));
const i::compiler::Operator* create_function_context = const i::compiler::Operator* create_function_context =
t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE); t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE);
...@@ -540,7 +539,7 @@ TEST(ReduceJSStoreContext2) { ...@@ -540,7 +539,7 @@ TEST(ReduceJSStoreContext2) {
Node* start = t.graph()->NewNode(t.common()->Start(0)); Node* start = t.graph()->NewNode(t.common()->Start(0));
t.graph()->SetStart(start); t.graph()->SetStart(start);
Handle<ScopeInfo> empty(ScopeInfo::Empty(t.main_isolate()), t.main_isolate()); ScopeInfoRef empty = MakeRef(t.broker(), ScopeInfo::Empty(t.main_isolate()));
const i::compiler::Operator* create_function_context = const i::compiler::Operator* create_function_context =
t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE); t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE);
...@@ -606,8 +605,7 @@ TEST(ReduceJSStoreContext3) { ...@@ -606,8 +605,7 @@ TEST(ReduceJSStoreContext3) {
Node* start = t.graph()->NewNode(t.common()->Start(2)); Node* start = t.graph()->NewNode(t.common()->Start(2));
t.graph()->SetStart(start); t.graph()->SetStart(start);
Handle<ScopeInfo> empty(ScopeInfo::Empty(t.main_isolate()), ScopeInfoRef empty = MakeRef(t.broker(), ScopeInfo::Empty(t.main_isolate()));
handle_zone_scope.main_isolate());
const i::compiler::Operator* create_function_context = const i::compiler::Operator* create_function_context =
t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE); t.javascript()->CreateFunctionContext(empty, 42, FUNCTION_SCOPE);
......
...@@ -157,7 +157,7 @@ TEST_F(JSCreateLoweringTest, JSCreateFunctionContextViaInlinedAllocation) { ...@@ -157,7 +157,7 @@ TEST_F(JSCreateLoweringTest, JSCreateFunctionContextViaInlinedAllocation) {
Node* const control = graph()->start(); Node* const control = graph()->start();
Reduction const r = Reduce(graph()->NewNode( Reduction const r = Reduce(graph()->NewNode(
javascript()->CreateFunctionContext( javascript()->CreateFunctionContext(
handle(ScopeInfo::Empty(isolate()), isolate()), 8, FUNCTION_SCOPE), MakeRef(broker(), ScopeInfo::Empty(isolate())), 8, FUNCTION_SCOPE),
context, effect, control)); context, effect, control));
ASSERT_TRUE(r.Changed()); ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), EXPECT_THAT(r.replacement(),
...@@ -171,8 +171,8 @@ TEST_F(JSCreateLoweringTest, JSCreateFunctionContextViaInlinedAllocation) { ...@@ -171,8 +171,8 @@ TEST_F(JSCreateLoweringTest, JSCreateFunctionContextViaInlinedAllocation) {
// JSCreateWithContext // JSCreateWithContext
TEST_F(JSCreateLoweringTest, JSCreateWithContext) { TEST_F(JSCreateLoweringTest, JSCreateWithContext) {
Handle<ScopeInfo> scope_info = ScopeInfoRef scope_info =
ReadOnlyRoots(isolate()).empty_function_scope_info_handle(); MakeRef(broker(), ReadOnlyRoots(isolate()).empty_function_scope_info());
Node* const object = Parameter(Type::Receiver()); Node* const object = Parameter(Type::Receiver());
Node* const context = Parameter(Type::Any()); Node* const context = Parameter(Type::Any());
Node* const effect = graph()->start(); Node* const effect = graph()->start();
...@@ -193,8 +193,8 @@ TEST_F(JSCreateLoweringTest, JSCreateWithContext) { ...@@ -193,8 +193,8 @@ TEST_F(JSCreateLoweringTest, JSCreateWithContext) {
// JSCreateCatchContext // JSCreateCatchContext
TEST_F(JSCreateLoweringTest, JSCreateCatchContext) { TEST_F(JSCreateLoweringTest, JSCreateCatchContext) {
Handle<ScopeInfo> scope_info = ScopeInfoRef scope_info =
ReadOnlyRoots(isolate()).empty_function_scope_info_handle(); MakeRef(broker(), ReadOnlyRoots(isolate()).empty_function_scope_info());
Node* const exception = Parameter(Type::Receiver()); Node* const exception = Parameter(Type::Receiver());
Node* const context = Parameter(Type::Any()); Node* const context = Parameter(Type::Any());
Node* const effect = graph()->start(); Node* const effect = graph()->start();
......
...@@ -400,7 +400,7 @@ TEST_F(JSTypedLoweringTest, JSStoreContext) { ...@@ -400,7 +400,7 @@ TEST_F(JSTypedLoweringTest, JSStoreContext) {
TEST_F(JSTypedLoweringTest, JSLoadNamedStringLength) { TEST_F(JSTypedLoweringTest, JSLoadNamedStringLength) {
Handle<Name> name = factory()->length_string(); NameRef name = MakeRef(broker(), factory()->length_string());
Node* const receiver = Parameter(Type::String(), 0); Node* const receiver = Parameter(Type::String(), 0);
Node* const feedback = UndefinedConstant(); Node* const feedback = UndefinedConstant();
Node* const context = UndefinedConstant(); Node* const context = UndefinedConstant();
......
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