Index: src/code-stubs.cc |
diff --git a/src/code-stubs.cc b/src/code-stubs.cc |
index 6f8251a70073e086d88f7fef48cac808d45d8969..6a71ca0c8c493848599e452a615127dbbe807747 100644 |
--- a/src/code-stubs.cc |
+++ b/src/code-stubs.cc |
@@ -5135,9 +5135,7 @@ void FastNewClosureStub::GenerateAssembly(CodeStubAssembler* assembler) const { |
compiler::Node* FastNewFunctionContextStub::Generate( |
CodeStubAssembler* assembler, compiler::Node* function, |
compiler::Node* slots, compiler::Node* context) { |
- typedef CodeStubAssembler::Label Label; |
typedef compiler::Node Node; |
- typedef CodeStubAssembler::Variable Variable; |
Node* min_context_slots = |
assembler->Int32Constant(Context::MIN_CONTEXT_SLOTS); |
@@ -5176,24 +5174,12 @@ compiler::Node* FastNewFunctionContextStub::Generate( |
// Initialize the rest of the slots to undefined. |
Node* undefined = assembler->UndefinedConstant(); |
- Variable var_slot_index(assembler, MachineRepresentation::kWord32); |
- var_slot_index.Bind(min_context_slots); |
- Label loop(assembler, &var_slot_index), after_loop(assembler); |
- assembler->Goto(&loop); |
- |
- assembler->Bind(&loop); |
- { |
- Node* slot_index = var_slot_index.value(); |
- assembler->GotoUnless(assembler->Int32LessThan(slot_index, length), |
- &after_loop); |
- assembler->StoreFixedArrayElement(function_context, slot_index, undefined, |
- SKIP_WRITE_BARRIER); |
- Node* one = assembler->Int32Constant(1); |
- Node* next_index = assembler->Int32Add(slot_index, one); |
- var_slot_index.Bind(next_index); |
- assembler->Goto(&loop); |
- } |
- assembler->Bind(&after_loop); |
+ assembler->BuildFastFixedArrayForEach( |
+ function_context, FAST_ELEMENTS, min_context_slots, length, |
+ [undefined](CodeStubAssembler* assembler, Node* context, Node* offset) { |
+ assembler->StoreNoWriteBarrier(MachineType::PointerRepresentation(), |
+ context, offset, undefined); |
+ }); |
return function_context; |
} |