Commit cdff697b authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Rename FullCodeGenerator::function to literal.

R=titzer@chromium.org

Review URL: https://codereview.chromium.org/1310603002

Cr-Commit-Position: refs/heads/master@{#30312}
parent b7cf7327
...@@ -105,7 +105,7 @@ void FullCodeGenerator::Generate() { ...@@ -105,7 +105,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_; CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell( profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
SetFunctionPosition(function()); SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator"); Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_); ProfileEntryHookStub::MaybeCallEntryHook(masm_);
...@@ -318,7 +318,7 @@ void FullCodeGenerator::Generate() { ...@@ -318,7 +318,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type; ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) { if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT; type = ArgumentsAccessStub::NEW_STRICT;
} else if (function()->has_duplicate_parameters()) { } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else { } else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST; type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
...@@ -367,7 +367,7 @@ void FullCodeGenerator::Generate() { ...@@ -367,7 +367,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body"); { Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
VisitStatements(function()->body()); VisitStatements(literal()->body());
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
} }
} }
...@@ -494,7 +494,7 @@ void FullCodeGenerator::EmitReturnSequence() { ...@@ -494,7 +494,7 @@ void FullCodeGenerator::EmitReturnSequence() {
{ Assembler::BlockConstPoolScope block_const_pool(masm_); { Assembler::BlockConstPoolScope block_const_pool(masm_);
int32_t arg_count = info_->scope()->num_parameters() + 1; int32_t arg_count = info_->scope()->num_parameters() + 1;
int32_t sp_delta = arg_count * kPointerSize; int32_t sp_delta = arg_count * kPointerSize;
SetReturnPosition(function()); SetReturnPosition(literal());
// TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5!
PredictableCodeSizeScope predictable(masm_, -1); PredictableCodeSizeScope predictable(masm_, -1);
int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT); int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT);
......
...@@ -104,7 +104,7 @@ void FullCodeGenerator::Generate() { ...@@ -104,7 +104,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_; CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell( profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
SetFunctionPosition(function()); SetFunctionPosition(literal());
Comment cmnt(masm_, "[ Function compiled by full code generator"); Comment cmnt(masm_, "[ Function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_); ProfileEntryHookStub::MaybeCallEntryHook(masm_);
...@@ -325,7 +325,7 @@ void FullCodeGenerator::Generate() { ...@@ -325,7 +325,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type; ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) { if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT; type = ArgumentsAccessStub::NEW_STRICT;
} else if (function()->has_duplicate_parameters()) { } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else { } else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST; type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
...@@ -373,7 +373,7 @@ void FullCodeGenerator::Generate() { ...@@ -373,7 +373,7 @@ void FullCodeGenerator::Generate() {
{ {
Comment cmnt(masm_, "[ Body"); Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
VisitStatements(function()->body()); VisitStatements(literal()->body());
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
} }
} }
...@@ -485,7 +485,7 @@ void FullCodeGenerator::EmitReturnSequence() { ...@@ -485,7 +485,7 @@ void FullCodeGenerator::EmitReturnSequence() {
EmitProfilingCounterReset(); EmitProfilingCounterReset();
__ Bind(&ok); __ Bind(&ok);
SetReturnPosition(function()); SetReturnPosition(literal());
const Register& current_sp = __ StackPointer(); const Register& current_sp = __ StackPointer();
// Nothing ensures 16 bytes alignment here. // Nothing ensures 16 bytes alignment here.
DCHECK(!current_sp.Is(csp)); DCHECK(!current_sp.Is(csp));
......
...@@ -696,10 +696,9 @@ class FullCodeGenerator: public AstVisitor { ...@@ -696,10 +696,9 @@ class FullCodeGenerator: public AstVisitor {
Handle<Script> script() { return info_->script(); } Handle<Script> script() { return info_->script(); }
bool is_eval() { return info_->is_eval(); } bool is_eval() { return info_->is_eval(); }
bool is_native() { return info_->is_native(); } bool is_native() { return info_->is_native(); }
LanguageMode language_mode() { return function()->language_mode(); } LanguageMode language_mode() { return literal()->language_mode(); }
bool has_simple_parameters() { return info_->has_simple_parameters(); } bool has_simple_parameters() { return info_->has_simple_parameters(); }
// TODO(titzer): rename this to literal(). FunctionLiteral* literal() { return info_->literal(); }
FunctionLiteral* function() { return info_->literal(); }
Scope* scope() { return scope_; } Scope* scope() { return scope_; }
static Register result_register(); static Register result_register();
......
...@@ -94,14 +94,14 @@ void FullCodeGenerator::Generate() { ...@@ -94,14 +94,14 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_; CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell( profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
SetFunctionPosition(function()); SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator"); Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_); ProfileEntryHookStub::MaybeCallEntryHook(masm_);
#ifdef DEBUG #ifdef DEBUG
if (strlen(FLAG_stop_at) > 0 && if (strlen(FLAG_stop_at) > 0 &&
function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
__ int3(); __ int3();
} }
#endif #endif
...@@ -139,7 +139,7 @@ void FullCodeGenerator::Generate() { ...@@ -139,7 +139,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Allocate locals"); { Comment cmnt(masm_, "[ Allocate locals");
int locals_count = info->scope()->num_stack_slots(); int locals_count = info->scope()->num_stack_slots();
// Generators allocate locals, if any, in context slots. // Generators allocate locals, if any, in context slots.
DCHECK(!IsGeneratorFunction(function()->kind()) || locals_count == 0); DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0);
if (locals_count == 1) { if (locals_count == 1) {
__ push(Immediate(isolate()->factory()->undefined_value())); __ push(Immediate(isolate()->factory()->undefined_value()));
} else if (locals_count > 1) { } else if (locals_count > 1) {
...@@ -321,7 +321,7 @@ void FullCodeGenerator::Generate() { ...@@ -321,7 +321,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type; ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) { if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT; type = ArgumentsAccessStub::NEW_STRICT;
} else if (function()->has_duplicate_parameters()) { } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else { } else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST; type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
...@@ -367,7 +367,7 @@ void FullCodeGenerator::Generate() { ...@@ -367,7 +367,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body"); { Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
VisitStatements(function()->body()); VisitStatements(literal()->body());
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
} }
} }
...@@ -460,7 +460,7 @@ void FullCodeGenerator::EmitReturnSequence() { ...@@ -460,7 +460,7 @@ void FullCodeGenerator::EmitReturnSequence() {
EmitProfilingCounterReset(); EmitProfilingCounterReset();
__ bind(&ok); __ bind(&ok);
SetReturnPosition(function()); SetReturnPosition(literal());
int no_frame_start = masm_->pc_offset(); int no_frame_start = masm_->pc_offset();
__ leave(); __ leave();
...@@ -1412,8 +1412,8 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, ...@@ -1412,8 +1412,8 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy,
if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) {
skip_init_check = false; skip_init_check = false;
} else if (var->is_this()) { } else if (var->is_this()) {
CHECK(function() != nullptr && CHECK(literal() != nullptr &&
(function()->kind() & kSubclassConstructor) != 0); (literal()->kind() & kSubclassConstructor) != 0);
// TODO(dslomov): implement 'this' hole check elimination. // TODO(dslomov): implement 'this' hole check elimination.
skip_init_check = false; skip_init_check = false;
} else { } else {
......
...@@ -113,7 +113,7 @@ void FullCodeGenerator::Generate() { ...@@ -113,7 +113,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_; CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell( profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
SetFunctionPosition(function()); SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator"); Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_); ProfileEntryHookStub::MaybeCallEntryHook(masm_);
...@@ -337,7 +337,7 @@ void FullCodeGenerator::Generate() { ...@@ -337,7 +337,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type; ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) { if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT; type = ArgumentsAccessStub::NEW_STRICT;
} else if (function()->has_duplicate_parameters()) { } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else { } else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST; type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
...@@ -383,7 +383,7 @@ void FullCodeGenerator::Generate() { ...@@ -383,7 +383,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body"); { Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
VisitStatements(function()->body()); VisitStatements(literal()->body());
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
} }
} }
...@@ -495,7 +495,7 @@ void FullCodeGenerator::EmitReturnSequence() { ...@@ -495,7 +495,7 @@ void FullCodeGenerator::EmitReturnSequence() {
// tool from instrumenting as we rely on the code size here. // tool from instrumenting as we rely on the code size here.
int32_t arg_count = info_->scope()->num_parameters() + 1; int32_t arg_count = info_->scope()->num_parameters() + 1;
int32_t sp_delta = arg_count * kPointerSize; int32_t sp_delta = arg_count * kPointerSize;
SetReturnPosition(function()); SetReturnPosition(literal());
masm_->mov(sp, fp); masm_->mov(sp, fp);
int no_frame_start = masm_->pc_offset(); int no_frame_start = masm_->pc_offset();
masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit())); masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit()));
......
...@@ -113,7 +113,7 @@ void FullCodeGenerator::Generate() { ...@@ -113,7 +113,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_; CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell( profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
SetFunctionPosition(function()); SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator"); Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_); ProfileEntryHookStub::MaybeCallEntryHook(masm_);
...@@ -333,7 +333,7 @@ void FullCodeGenerator::Generate() { ...@@ -333,7 +333,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type; ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) { if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT; type = ArgumentsAccessStub::NEW_STRICT;
} else if (function()->has_duplicate_parameters()) { } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else { } else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST; type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
...@@ -379,7 +379,7 @@ void FullCodeGenerator::Generate() { ...@@ -379,7 +379,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body"); { Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
VisitStatements(function()->body()); VisitStatements(literal()->body());
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
} }
...@@ -492,7 +492,7 @@ void FullCodeGenerator::EmitReturnSequence() { ...@@ -492,7 +492,7 @@ void FullCodeGenerator::EmitReturnSequence() {
// tool from instrumenting as we rely on the code size here. // tool from instrumenting as we rely on the code size here.
int32_t arg_count = info_->scope()->num_parameters() + 1; int32_t arg_count = info_->scope()->num_parameters() + 1;
int32_t sp_delta = arg_count * kPointerSize; int32_t sp_delta = arg_count * kPointerSize;
SetReturnPosition(function()); SetReturnPosition(literal());
masm_->mov(sp, fp); masm_->mov(sp, fp);
int no_frame_start = masm_->pc_offset(); int no_frame_start = masm_->pc_offset();
masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit())); masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit()));
......
...@@ -102,7 +102,7 @@ void FullCodeGenerator::Generate() { ...@@ -102,7 +102,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_; CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell( profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
SetFunctionPosition(function()); SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator"); Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_); ProfileEntryHookStub::MaybeCallEntryHook(masm_);
...@@ -330,7 +330,7 @@ void FullCodeGenerator::Generate() { ...@@ -330,7 +330,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type; ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) { if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT; type = ArgumentsAccessStub::NEW_STRICT;
} else if (function()->has_duplicate_parameters()) { } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else { } else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST; type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
...@@ -377,7 +377,7 @@ void FullCodeGenerator::Generate() { ...@@ -377,7 +377,7 @@ void FullCodeGenerator::Generate() {
{ {
Comment cmnt(masm_, "[ Body"); Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
VisitStatements(function()->body()); VisitStatements(literal()->body());
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
} }
} }
...@@ -487,7 +487,7 @@ void FullCodeGenerator::EmitReturnSequence() { ...@@ -487,7 +487,7 @@ void FullCodeGenerator::EmitReturnSequence() {
Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_);
int32_t arg_count = info_->scope()->num_parameters() + 1; int32_t arg_count = info_->scope()->num_parameters() + 1;
int32_t sp_delta = arg_count * kPointerSize; int32_t sp_delta = arg_count * kPointerSize;
SetReturnPosition(function()); SetReturnPosition(literal());
int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta); int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta);
__ blr(); __ blr();
info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); info_->AddNoFrameRange(no_frame_start, masm_->pc_offset());
......
...@@ -93,7 +93,7 @@ void FullCodeGenerator::Generate() { ...@@ -93,7 +93,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_; CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell( profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
SetFunctionPosition(function()); SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator"); Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_); ProfileEntryHookStub::MaybeCallEntryHook(masm_);
...@@ -319,7 +319,7 @@ void FullCodeGenerator::Generate() { ...@@ -319,7 +319,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type; ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) { if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT; type = ArgumentsAccessStub::NEW_STRICT;
} else if (function()->has_duplicate_parameters()) { } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else { } else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST; type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
...@@ -362,7 +362,7 @@ void FullCodeGenerator::Generate() { ...@@ -362,7 +362,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body"); { Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
VisitStatements(function()->body()); VisitStatements(literal()->body());
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
} }
} }
...@@ -462,7 +462,7 @@ void FullCodeGenerator::EmitReturnSequence() { ...@@ -462,7 +462,7 @@ void FullCodeGenerator::EmitReturnSequence() {
EmitProfilingCounterReset(); EmitProfilingCounterReset();
__ bind(&ok); __ bind(&ok);
SetReturnPosition(function()); SetReturnPosition(literal());
int no_frame_start = masm_->pc_offset(); int no_frame_start = masm_->pc_offset();
__ leave(); __ leave();
......
...@@ -94,14 +94,14 @@ void FullCodeGenerator::Generate() { ...@@ -94,14 +94,14 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_; CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell( profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
SetFunctionPosition(function()); SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator"); Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_); ProfileEntryHookStub::MaybeCallEntryHook(masm_);
#ifdef DEBUG #ifdef DEBUG
if (strlen(FLAG_stop_at) > 0 && if (strlen(FLAG_stop_at) > 0 &&
function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
__ int3(); __ int3();
} }
#endif #endif
...@@ -139,7 +139,7 @@ void FullCodeGenerator::Generate() { ...@@ -139,7 +139,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Allocate locals"); { Comment cmnt(masm_, "[ Allocate locals");
int locals_count = info->scope()->num_stack_slots(); int locals_count = info->scope()->num_stack_slots();
// Generators allocate locals, if any, in context slots. // Generators allocate locals, if any, in context slots.
DCHECK(!IsGeneratorFunction(function()->kind()) || locals_count == 0); DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0);
if (locals_count == 1) { if (locals_count == 1) {
__ push(Immediate(isolate()->factory()->undefined_value())); __ push(Immediate(isolate()->factory()->undefined_value()));
} else if (locals_count > 1) { } else if (locals_count > 1) {
...@@ -318,7 +318,7 @@ void FullCodeGenerator::Generate() { ...@@ -318,7 +318,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type; ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) { if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT; type = ArgumentsAccessStub::NEW_STRICT;
} else if (function()->has_duplicate_parameters()) { } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else { } else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST; type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
...@@ -364,7 +364,7 @@ void FullCodeGenerator::Generate() { ...@@ -364,7 +364,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body"); { Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
VisitStatements(function()->body()); VisitStatements(literal()->body());
DCHECK(loop_depth() == 0); DCHECK(loop_depth() == 0);
} }
} }
...@@ -457,7 +457,7 @@ void FullCodeGenerator::EmitReturnSequence() { ...@@ -457,7 +457,7 @@ void FullCodeGenerator::EmitReturnSequence() {
EmitProfilingCounterReset(); EmitProfilingCounterReset();
__ bind(&ok); __ bind(&ok);
SetReturnPosition(function()); SetReturnPosition(literal());
int no_frame_start = masm_->pc_offset(); int no_frame_start = masm_->pc_offset();
__ leave(); __ leave();
......
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