Remove some leftovers of full-codegen's generators implementation.
TBR=littledan@chromium.org BUG= Review-Url: https://codereview.chromium.org/2517143003 Cr-Commit-Position: refs/heads/master@{#41180}
This commit is contained in:
parent
cda1a60ab3
commit
c051ef383d
@ -1395,9 +1395,6 @@ class Assembler : public AssemblerBase {
|
||||
|
||||
// Debugging
|
||||
|
||||
// Mark generator continuation.
|
||||
void RecordGeneratorContinuation();
|
||||
|
||||
// Mark address of a debug break slot.
|
||||
void RecordDebugBreakSlot(RelocInfo::Mode mode);
|
||||
|
||||
|
@ -2950,15 +2950,13 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
|
||||
(rmode == RelocInfo::CONST_POOL) || (rmode == RelocInfo::VENEER_POOL) ||
|
||||
(rmode == RelocInfo::DEOPT_SCRIPT_OFFSET) ||
|
||||
(rmode == RelocInfo::DEOPT_INLINING_ID) ||
|
||||
(rmode == RelocInfo::DEOPT_REASON) || (rmode == RelocInfo::DEOPT_ID) ||
|
||||
(rmode == RelocInfo::GENERATOR_CONTINUATION)) {
|
||||
(rmode == RelocInfo::DEOPT_REASON) || (rmode == RelocInfo::DEOPT_ID)) {
|
||||
// Adjust code for new modes.
|
||||
DCHECK(RelocInfo::IsDebugBreakSlot(rmode) || RelocInfo::IsComment(rmode) ||
|
||||
RelocInfo::IsDeoptReason(rmode) || RelocInfo::IsDeoptId(rmode) ||
|
||||
RelocInfo::IsDeoptPosition(rmode) ||
|
||||
RelocInfo::IsInternalReference(rmode) ||
|
||||
RelocInfo::IsConstPool(rmode) || RelocInfo::IsVeneerPool(rmode) ||
|
||||
RelocInfo::IsGeneratorContinuation(rmode));
|
||||
RelocInfo::IsConstPool(rmode) || RelocInfo::IsVeneerPool(rmode));
|
||||
// These modes do not need an entry in the constant pool.
|
||||
} else {
|
||||
constpool_.RecordEntry(data, rmode);
|
||||
|
@ -938,9 +938,6 @@ class Assembler : public AssemblerBase {
|
||||
|
||||
int buffer_space() const;
|
||||
|
||||
// Mark generator continuation.
|
||||
void RecordGeneratorContinuation();
|
||||
|
||||
// Mark address of a debug break slot.
|
||||
void RecordDebugBreakSlot(RelocInfo::Mode mode);
|
||||
|
||||
|
@ -782,8 +782,6 @@ const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) {
|
||||
return "debug break slot at tail call";
|
||||
case CODE_AGE_SEQUENCE:
|
||||
return "code age sequence";
|
||||
case GENERATOR_CONTINUATION:
|
||||
return "generator continuation";
|
||||
case WASM_MEMORY_REFERENCE:
|
||||
return "wasm memory reference";
|
||||
case WASM_MEMORY_SIZE_REFERENCE:
|
||||
@ -884,7 +882,6 @@ void RelocInfo::Verify(Isolate* isolate) {
|
||||
case DEBUG_BREAK_SLOT_AT_RETURN:
|
||||
case DEBUG_BREAK_SLOT_AT_CALL:
|
||||
case DEBUG_BREAK_SLOT_AT_TAIL_CALL:
|
||||
case GENERATOR_CONTINUATION:
|
||||
case WASM_MEMORY_REFERENCE:
|
||||
case WASM_MEMORY_SIZE_REFERENCE:
|
||||
case WASM_GLOBAL_REFERENCE:
|
||||
@ -1914,12 +1911,6 @@ void Assembler::RecordComment(const char* msg) {
|
||||
}
|
||||
|
||||
|
||||
void Assembler::RecordGeneratorContinuation() {
|
||||
EnsureSpace ensure_space(this);
|
||||
RecordRelocInfo(RelocInfo::GENERATOR_CONTINUATION);
|
||||
}
|
||||
|
||||
|
||||
void Assembler::RecordDebugBreakSlot(RelocInfo::Mode mode) {
|
||||
EnsureSpace ensure_space(this);
|
||||
DCHECK(RelocInfo::IsDebugBreakSlot(mode));
|
||||
|
@ -413,9 +413,6 @@ class RelocInfo {
|
||||
// Encoded internal reference, used only on MIPS, MIPS64 and PPC.
|
||||
INTERNAL_REFERENCE_ENCODED,
|
||||
|
||||
// Continuation points for a generator yield.
|
||||
GENERATOR_CONTINUATION,
|
||||
|
||||
// Marks constant and veneer pools. Only used on ARM and ARM64.
|
||||
// They use a custom noncompact encoding.
|
||||
CONST_POOL,
|
||||
@ -524,9 +521,6 @@ class RelocInfo {
|
||||
static inline bool IsCodeAgeSequence(Mode mode) {
|
||||
return mode == CODE_AGE_SEQUENCE;
|
||||
}
|
||||
static inline bool IsGeneratorContinuation(Mode mode) {
|
||||
return mode == GENERATOR_CONTINUATION;
|
||||
}
|
||||
static inline bool IsWasmMemoryReference(Mode mode) {
|
||||
return mode == WASM_MEMORY_REFERENCE;
|
||||
}
|
||||
|
@ -1178,29 +1178,15 @@ static Address ComputeNewPcForRedirect(Code* new_code, Code* old_code,
|
||||
|
||||
// Count the number of continuations at which the current pc offset is at.
|
||||
static int ComputeContinuationIndexFromPcOffset(Code* code, int pc_offset) {
|
||||
DCHECK_EQ(code->kind(), Code::FUNCTION);
|
||||
Address pc = code->instruction_start() + pc_offset;
|
||||
int mask = RelocInfo::ModeMask(RelocInfo::GENERATOR_CONTINUATION);
|
||||
int index = 0;
|
||||
for (RelocIterator it(code, mask); !it.done(); it.next()) {
|
||||
index++;
|
||||
RelocInfo* rinfo = it.rinfo();
|
||||
Address current_pc = rinfo->pc();
|
||||
if (current_pc == pc) break;
|
||||
DCHECK(current_pc < pc);
|
||||
}
|
||||
return index;
|
||||
UNREACHABLE();
|
||||
return 666;
|
||||
}
|
||||
|
||||
|
||||
// Find the pc offset for the given continuation index.
|
||||
static int ComputePcOffsetFromContinuationIndex(Code* code, int index) {
|
||||
DCHECK_EQ(code->kind(), Code::FUNCTION);
|
||||
DCHECK(code->has_debug_break_slots());
|
||||
int mask = RelocInfo::ModeMask(RelocInfo::GENERATOR_CONTINUATION);
|
||||
RelocIterator it(code, mask);
|
||||
for (int i = 1; i < index; i++) it.next();
|
||||
return static_cast<int>(it.rinfo()->pc() - code->instruction_start());
|
||||
UNREACHABLE();
|
||||
return 666;
|
||||
}
|
||||
|
||||
|
||||
@ -1293,6 +1279,7 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) {
|
||||
HeapIterator iterator(isolate_->heap());
|
||||
HeapObject* obj;
|
||||
// Continuation from old-style generators need to be recomputed.
|
||||
// TODO(yangguo): Remove code for old-style generators.
|
||||
bool find_resumables =
|
||||
baseline_exists && IsResumableFunction(shared->kind());
|
||||
|
||||
|
@ -144,8 +144,6 @@ void FullCodeGenerator::Generate() {
|
||||
|
||||
{ Comment cmnt(masm_, "[ Allocate locals");
|
||||
int locals_count = info->scope()->num_stack_slots();
|
||||
// Generators allocate locals, if any, in context slots.
|
||||
DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
|
||||
OperandStackDepthIncrement(locals_count);
|
||||
if (locals_count > 0) {
|
||||
if (locals_count >= 128) {
|
||||
|
@ -149,8 +149,6 @@ void FullCodeGenerator::Generate() {
|
||||
// Reserve space on the stack for locals.
|
||||
{ Comment cmnt(masm_, "[ Allocate locals");
|
||||
int locals_count = info->scope()->num_stack_slots();
|
||||
// Generators allocate locals, if any, in context slots.
|
||||
DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
|
||||
OperandStackDepthIncrement(locals_count);
|
||||
if (locals_count > 0) {
|
||||
if (locals_count >= 128) {
|
||||
|
@ -130,8 +130,6 @@ void FullCodeGenerator::Generate() {
|
||||
|
||||
{ Comment cmnt(masm_, "[ Allocate locals");
|
||||
int locals_count = info->scope()->num_stack_slots();
|
||||
// Generators allocate locals, if any, in context slots.
|
||||
DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0);
|
||||
OperandStackDepthIncrement(locals_count);
|
||||
if (locals_count == 1) {
|
||||
__ push(Immediate(isolate()->factory()->undefined_value()));
|
||||
|
@ -153,8 +153,6 @@ void FullCodeGenerator::Generate() {
|
||||
|
||||
{ Comment cmnt(masm_, "[ Allocate locals");
|
||||
int locals_count = info->scope()->num_stack_slots();
|
||||
// Generators allocate locals, if any, in context slots.
|
||||
DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
|
||||
OperandStackDepthIncrement(locals_count);
|
||||
if (locals_count > 0) {
|
||||
if (locals_count >= 128) {
|
||||
|
@ -152,8 +152,6 @@ void FullCodeGenerator::Generate() {
|
||||
|
||||
{ Comment cmnt(masm_, "[ Allocate locals");
|
||||
int locals_count = info->scope()->num_stack_slots();
|
||||
// Generators allocate locals, if any, in context slots.
|
||||
DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
|
||||
OperandStackDepthIncrement(locals_count);
|
||||
if (locals_count > 0) {
|
||||
if (locals_count >= 128) {
|
||||
|
@ -152,8 +152,6 @@ void FullCodeGenerator::Generate() {
|
||||
{
|
||||
Comment cmnt(masm_, "[ Allocate locals");
|
||||
int locals_count = info->scope()->num_stack_slots();
|
||||
// Generators allocate locals, if any, in context slots.
|
||||
DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
|
||||
OperandStackDepthIncrement(locals_count);
|
||||
if (locals_count > 0) {
|
||||
if (locals_count >= 128) {
|
||||
|
@ -151,8 +151,6 @@ void FullCodeGenerator::Generate() {
|
||||
{
|
||||
Comment cmnt(masm_, "[ Allocate locals");
|
||||
int locals_count = info->scope()->num_stack_slots();
|
||||
// Generators allocate locals, if any, in context slots.
|
||||
DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
|
||||
OperandStackDepthIncrement(locals_count);
|
||||
if (locals_count > 0) {
|
||||
if (locals_count >= 128) {
|
||||
|
@ -131,8 +131,6 @@ void FullCodeGenerator::Generate() {
|
||||
|
||||
{ Comment cmnt(masm_, "[ Allocate locals");
|
||||
int locals_count = info->scope()->num_stack_slots();
|
||||
// Generators allocate locals, if any, in context slots.
|
||||
DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
|
||||
OperandStackDepthIncrement(locals_count);
|
||||
if (locals_count == 1) {
|
||||
__ PushRoot(Heap::kUndefinedValueRootIndex);
|
||||
|
@ -130,8 +130,6 @@ void FullCodeGenerator::Generate() {
|
||||
|
||||
{ Comment cmnt(masm_, "[ Allocate locals");
|
||||
int locals_count = info->scope()->num_stack_slots();
|
||||
// Generators allocate locals, if any, in context slots.
|
||||
DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0);
|
||||
OperandStackDepthIncrement(locals_count);
|
||||
if (locals_count == 1) {
|
||||
__ push(Immediate(isolate()->factory()->undefined_value()));
|
||||
|
@ -1434,9 +1434,6 @@ class Assembler : public AssemblerBase {
|
||||
return pc_offset() - label->pos();
|
||||
}
|
||||
|
||||
// Mark generator continuation.
|
||||
void RecordGeneratorContinuation();
|
||||
|
||||
// Mark address of a debug break slot.
|
||||
void RecordDebugBreakSlot(RelocInfo::Mode mode);
|
||||
|
||||
|
@ -1029,9 +1029,6 @@ class Assembler : public AssemblerBase {
|
||||
|
||||
// Debugging.
|
||||
|
||||
// Mark generator continuation.
|
||||
void RecordGeneratorContinuation();
|
||||
|
||||
// Mark address of a debug break slot.
|
||||
void RecordDebugBreakSlot(RelocInfo::Mode mode);
|
||||
|
||||
|
@ -1091,9 +1091,6 @@ class Assembler : public AssemblerBase {
|
||||
|
||||
// Debugging.
|
||||
|
||||
// Mark generator continuation.
|
||||
void RecordGeneratorContinuation();
|
||||
|
||||
// Mark address of a debug break slot.
|
||||
void RecordDebugBreakSlot(RelocInfo::Mode mode);
|
||||
|
||||
|
@ -19749,24 +19749,14 @@ void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
|
||||
|
||||
int JSGeneratorObject::source_position() const {
|
||||
CHECK(is_suspended());
|
||||
AbstractCode* code;
|
||||
int code_offset;
|
||||
if (function()->shared()->HasBytecodeArray()) {
|
||||
// New-style generators.
|
||||
DCHECK(!function()->shared()->HasBaselineCode());
|
||||
code_offset = Smi::cast(input_or_debug_pos())->value();
|
||||
// The stored bytecode offset is relative to a different base than what
|
||||
// is used in the source position table, hence the subtraction.
|
||||
code_offset -= BytecodeArray::kHeaderSize - kHeapObjectTag;
|
||||
code = AbstractCode::cast(function()->shared()->bytecode_array());
|
||||
} else {
|
||||
// Old-style generators.
|
||||
DCHECK(function()->shared()->HasBaselineCode());
|
||||
code_offset = continuation();
|
||||
CHECK(0 <= code_offset);
|
||||
CHECK(code_offset < function()->code()->instruction_size());
|
||||
code = AbstractCode::cast(function()->shared()->code());
|
||||
}
|
||||
DCHECK(function()->shared()->HasBytecodeArray());
|
||||
DCHECK(!function()->shared()->HasBaselineCode());
|
||||
int code_offset = Smi::cast(input_or_debug_pos())->value();
|
||||
// The stored bytecode offset is relative to a different base than what
|
||||
// is used in the source position table, hence the subtraction.
|
||||
code_offset -= BytecodeArray::kHeaderSize - kHeapObjectTag;
|
||||
AbstractCode* code =
|
||||
AbstractCode::cast(function()->shared()->bytecode_array());
|
||||
return code->SourcePosition(code_offset);
|
||||
}
|
||||
|
||||
|
@ -8057,8 +8057,7 @@ class JSGeneratorObject: public JSObject {
|
||||
|
||||
// [input_or_debug_pos]
|
||||
// For executing generators: the most recent input value.
|
||||
// For suspended new-style generators: debug information (bytecode offset).
|
||||
// For suspended old-style generators: unused.
|
||||
// For suspended generators: debug information (bytecode offset).
|
||||
// There is currently no need to remember the most recent input value for a
|
||||
// suspended generator.
|
||||
DECL_ACCESSORS(input_or_debug_pos, Object)
|
||||
|
@ -2503,10 +2503,10 @@ void Parser::ReindexLiterals(const ParserFormalParameters& parameters) {
|
||||
}
|
||||
|
||||
void Parser::PrepareGeneratorVariables(FunctionState* function_state) {
|
||||
// For generators, allocating variables in contexts is currently a win
|
||||
// because it minimizes the work needed to suspend and resume an
|
||||
// activation. The machine code produced for generators (by full-codegen)
|
||||
// relies on this forced context allocation, but not in an essential way.
|
||||
// For generators, allocating variables in contexts is currently a win because
|
||||
// it minimizes the work needed to suspend and resume an activation. The
|
||||
// code produced for generators relies on this forced context allocation, but
|
||||
// not in an essential way.
|
||||
scope()->ForceContextAllocation();
|
||||
|
||||
// Calling a generator returns a generator object. That object is stored
|
||||
|
@ -1188,9 +1188,6 @@ class Assembler : public AssemblerBase {
|
||||
|
||||
// Debugging
|
||||
|
||||
// Mark generator continuation.
|
||||
void RecordGeneratorContinuation();
|
||||
|
||||
// Mark address of a debug break slot.
|
||||
void RecordDebugBreakSlot(RelocInfo::Mode mode);
|
||||
|
||||
|
@ -1231,9 +1231,6 @@ class Assembler : public AssemblerBase {
|
||||
|
||||
// Debugging
|
||||
|
||||
// Mark generator continuation.
|
||||
void RecordGeneratorContinuation();
|
||||
|
||||
// Mark address of a debug break slot.
|
||||
void RecordDebugBreakSlot(RelocInfo::Mode mode);
|
||||
|
||||
|
@ -1981,9 +1981,6 @@ class Assembler : public AssemblerBase {
|
||||
return pc_offset() - label->pos();
|
||||
}
|
||||
|
||||
// Mark generator continuation.
|
||||
void RecordGeneratorContinuation();
|
||||
|
||||
// Mark address of a debug break slot.
|
||||
void RecordDebugBreakSlot(RelocInfo::Mode mode);
|
||||
|
||||
|
@ -957,9 +957,6 @@ class Assembler : public AssemblerBase {
|
||||
return pc_offset() - label->pos();
|
||||
}
|
||||
|
||||
// Mark generator continuation.
|
||||
void RecordGeneratorContinuation();
|
||||
|
||||
// Mark address of a debug break slot.
|
||||
void RecordDebugBreakSlot(RelocInfo::Mode mode);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user