Reviewers: titzer,
Description:
Rename FullCodeGenerator::function to literal.
[email protected]
Please review this at https://codereview.chromium.org/1310603002/
Base URL:
https://chromium.googlesource.com/v8/v8.git@local_cleanup-compilation-info-optimizable
Affected files (+40, -41 lines):
M src/full-codegen/arm/full-codegen-arm.cc
M src/full-codegen/arm64/full-codegen-arm64.cc
M src/full-codegen/full-codegen.h
M src/full-codegen/ia32/full-codegen-ia32.cc
M src/full-codegen/mips/full-codegen-mips.cc
M src/full-codegen/mips64/full-codegen-mips64.cc
M src/full-codegen/ppc/full-codegen-ppc.cc
M src/full-codegen/x64/full-codegen-x64.cc
M src/full-codegen/x87/full-codegen-x87.cc
Index: src/full-codegen/arm/full-codegen-arm.cc
diff --git a/src/full-codegen/arm/full-codegen-arm.cc
b/src/full-codegen/arm/full-codegen-arm.cc
index
17d30044cceaf6ad610b17ac0e81c17f76c1a400..891888d232def562938c690516bb0c84a7326abe
100644
--- a/src/full-codegen/arm/full-codegen-arm.cc
+++ b/src/full-codegen/arm/full-codegen-arm.cc
@@ -105,7 +105,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
- SetFunctionPosition(function());
+ SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_);
@@ -318,7 +318,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT;
- } else if (function()->has_duplicate_parameters()) {
+ } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
@@ -367,7 +367,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0);
- VisitStatements(function()->body());
+ VisitStatements(literal()->body());
DCHECK(loop_depth() == 0);
}
}
@@ -494,7 +494,7 @@ void FullCodeGenerator::EmitReturnSequence() {
{ Assembler::BlockConstPoolScope block_const_pool(masm_);
int32_t arg_count = info_->scope()->num_parameters() + 1;
int32_t sp_delta = arg_count * kPointerSize;
- SetReturnPosition(function());
+ SetReturnPosition(literal());
// TODO(svenpanne) The code below is sometimes 4 words, sometimes 5!
PredictableCodeSizeScope predictable(masm_, -1);
int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT);
Index: src/full-codegen/arm64/full-codegen-arm64.cc
diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc
b/src/full-codegen/arm64/full-codegen-arm64.cc
index
be70f638cef1da7ef25980a460cb636eda1abeae..9fa5e26f27a9099100e33a995d385249f8e459ce
100644
--- a/src/full-codegen/arm64/full-codegen-arm64.cc
+++ b/src/full-codegen/arm64/full-codegen-arm64.cc
@@ -104,7 +104,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
- SetFunctionPosition(function());
+ SetFunctionPosition(literal());
Comment cmnt(masm_, "[ Function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_);
@@ -325,7 +325,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT;
- } else if (function()->has_duplicate_parameters()) {
+ } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
@@ -373,7 +373,7 @@ void FullCodeGenerator::Generate() {
{
Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0);
- VisitStatements(function()->body());
+ VisitStatements(literal()->body());
DCHECK(loop_depth() == 0);
}
}
@@ -485,7 +485,7 @@ void FullCodeGenerator::EmitReturnSequence() {
EmitProfilingCounterReset();
__ Bind(&ok);
- SetReturnPosition(function());
+ SetReturnPosition(literal());
const Register& current_sp = __ StackPointer();
// Nothing ensures 16 bytes alignment here.
DCHECK(!current_sp.Is(csp));
Index: src/full-codegen/full-codegen.h
diff --git a/src/full-codegen/full-codegen.h
b/src/full-codegen/full-codegen.h
index
34a5dc0454793e65d4fc6be035c6f09735df7d8b..e8e8707c6b2a27f2811db8bd8d9259cfab0d8a4b
100644
--- a/src/full-codegen/full-codegen.h
+++ b/src/full-codegen/full-codegen.h
@@ -696,10 +696,9 @@ class FullCodeGenerator: public AstVisitor {
Handle<Script> script() { return info_->script(); }
bool is_eval() { return info_->is_eval(); }
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(); }
- // TODO(titzer): rename this to literal().
- FunctionLiteral* function() { return info_->literal(); }
+ FunctionLiteral* literal() { return info_->literal(); }
Scope* scope() { return scope_; }
static Register result_register();
Index: src/full-codegen/ia32/full-codegen-ia32.cc
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc
b/src/full-codegen/ia32/full-codegen-ia32.cc
index
2ed198b18403844254ac96453605952a113a650d..a46cf1e0ea6e1af44b50622e6e8f9f5b08e134a7
100644
--- a/src/full-codegen/ia32/full-codegen-ia32.cc
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc
@@ -94,14 +94,14 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
- SetFunctionPosition(function());
+ SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_);
#ifdef DEBUG
if (strlen(FLAG_stop_at) > 0 &&
- function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
+ literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
__ int3();
}
#endif
@@ -139,7 +139,7 @@ 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(function()->kind()) || locals_count == 0);
+ DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0);
if (locals_count == 1) {
__ push(Immediate(isolate()->factory()->undefined_value()));
} else if (locals_count > 1) {
@@ -321,7 +321,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT;
- } else if (function()->has_duplicate_parameters()) {
+ } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
@@ -367,7 +367,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0);
- VisitStatements(function()->body());
+ VisitStatements(literal()->body());
DCHECK(loop_depth() == 0);
}
}
@@ -460,7 +460,7 @@ void FullCodeGenerator::EmitReturnSequence() {
EmitProfilingCounterReset();
__ bind(&ok);
- SetReturnPosition(function());
+ SetReturnPosition(literal());
int no_frame_start = masm_->pc_offset();
__ leave();
@@ -1412,8 +1412,8 @@ void
FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy,
if (var->scope()->DeclarationScope() !=
scope()->DeclarationScope()) {
skip_init_check = false;
} else if (var->is_this()) {
- CHECK(function() != nullptr &&
- (function()->kind() & kSubclassConstructor) != 0);
+ CHECK(literal() != nullptr &&
+ (literal()->kind() & kSubclassConstructor) != 0);
// TODO(dslomov): implement 'this' hole check elimination.
skip_init_check = false;
} else {
Index: src/full-codegen/mips/full-codegen-mips.cc
diff --git a/src/full-codegen/mips/full-codegen-mips.cc
b/src/full-codegen/mips/full-codegen-mips.cc
index
3048372fbdf68b03cc9090c92803deed14ada619..7c5fc5ae91fa377514175975ac9227e7accced6b
100644
--- a/src/full-codegen/mips/full-codegen-mips.cc
+++ b/src/full-codegen/mips/full-codegen-mips.cc
@@ -113,7 +113,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
- SetFunctionPosition(function());
+ SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_);
@@ -337,7 +337,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT;
- } else if (function()->has_duplicate_parameters()) {
+ } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
@@ -383,7 +383,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0);
- VisitStatements(function()->body());
+ VisitStatements(literal()->body());
DCHECK(loop_depth() == 0);
}
}
@@ -495,7 +495,7 @@ void FullCodeGenerator::EmitReturnSequence() {
// tool from instrumenting as we rely on the code size here.
int32_t arg_count = info_->scope()->num_parameters() + 1;
int32_t sp_delta = arg_count * kPointerSize;
- SetReturnPosition(function());
+ SetReturnPosition(literal());
masm_->mov(sp, fp);
int no_frame_start = masm_->pc_offset();
masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit()));
Index: src/full-codegen/mips64/full-codegen-mips64.cc
diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc
b/src/full-codegen/mips64/full-codegen-mips64.cc
index
3edb1c3a3bf590545adb3ac8596e56b1dda6e647..5483258f6d87a00a8a2e171236f10bd47abc924f
100644
--- a/src/full-codegen/mips64/full-codegen-mips64.cc
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc
@@ -113,7 +113,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
- SetFunctionPosition(function());
+ SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_);
@@ -333,7 +333,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT;
- } else if (function()->has_duplicate_parameters()) {
+ } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
@@ -379,7 +379,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0);
- VisitStatements(function()->body());
+ VisitStatements(literal()->body());
DCHECK(loop_depth() == 0);
}
@@ -492,7 +492,7 @@ void FullCodeGenerator::EmitReturnSequence() {
// tool from instrumenting as we rely on the code size here.
int32_t arg_count = info_->scope()->num_parameters() + 1;
int32_t sp_delta = arg_count * kPointerSize;
- SetReturnPosition(function());
+ SetReturnPosition(literal());
masm_->mov(sp, fp);
int no_frame_start = masm_->pc_offset();
masm_->MultiPop(static_cast<RegList>(fp.bit() | ra.bit()));
Index: src/full-codegen/ppc/full-codegen-ppc.cc
diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc
b/src/full-codegen/ppc/full-codegen-ppc.cc
index
2d6e7867b560e03d2985b5523a630a90d08a4e33..60ac0b58b5b00d79525f6c2964738609c5f14d22
100644
--- a/src/full-codegen/ppc/full-codegen-ppc.cc
+++ b/src/full-codegen/ppc/full-codegen-ppc.cc
@@ -102,7 +102,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
- SetFunctionPosition(function());
+ SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_);
@@ -330,7 +330,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT;
- } else if (function()->has_duplicate_parameters()) {
+ } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
@@ -377,7 +377,7 @@ void FullCodeGenerator::Generate() {
{
Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0);
- VisitStatements(function()->body());
+ VisitStatements(literal()->body());
DCHECK(loop_depth() == 0);
}
}
@@ -487,7 +487,7 @@ void FullCodeGenerator::EmitReturnSequence() {
Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_);
int32_t arg_count = info_->scope()->num_parameters() + 1;
int32_t sp_delta = arg_count * kPointerSize;
- SetReturnPosition(function());
+ SetReturnPosition(literal());
int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT,
sp_delta);
__ blr();
info_->AddNoFrameRange(no_frame_start, masm_->pc_offset());
Index: src/full-codegen/x64/full-codegen-x64.cc
diff --git a/src/full-codegen/x64/full-codegen-x64.cc
b/src/full-codegen/x64/full-codegen-x64.cc
index
1647bd8da8d161a98e1b7493a2fd1a83ff5d45c8..f0796f7cb782f60561beb16a66df22b7ae98cf88
100644
--- a/src/full-codegen/x64/full-codegen-x64.cc
+++ b/src/full-codegen/x64/full-codegen-x64.cc
@@ -93,7 +93,7 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
- SetFunctionPosition(function());
+ SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_);
@@ -319,7 +319,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT;
- } else if (function()->has_duplicate_parameters()) {
+ } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
@@ -362,7 +362,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0);
- VisitStatements(function()->body());
+ VisitStatements(literal()->body());
DCHECK(loop_depth() == 0);
}
}
@@ -462,7 +462,7 @@ void FullCodeGenerator::EmitReturnSequence() {
EmitProfilingCounterReset();
__ bind(&ok);
- SetReturnPosition(function());
+ SetReturnPosition(literal());
int no_frame_start = masm_->pc_offset();
__ leave();
Index: src/full-codegen/x87/full-codegen-x87.cc
diff --git a/src/full-codegen/x87/full-codegen-x87.cc
b/src/full-codegen/x87/full-codegen-x87.cc
index
2ce87412ccb176891dcd6c78801987d191e302f6..db5e1f6d5f768124bf1f06987aa3b7f0550bc3cb
100644
--- a/src/full-codegen/x87/full-codegen-x87.cc
+++ b/src/full-codegen/x87/full-codegen-x87.cc
@@ -94,14 +94,14 @@ void FullCodeGenerator::Generate() {
CompilationInfo* info = info_;
profiling_counter_ = isolate()->factory()->NewCell(
Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
- SetFunctionPosition(function());
+ SetFunctionPosition(literal());
Comment cmnt(masm_, "[ function compiled by full code generator");
ProfileEntryHookStub::MaybeCallEntryHook(masm_);
#ifdef DEBUG
if (strlen(FLAG_stop_at) > 0 &&
- function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
+ literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
__ int3();
}
#endif
@@ -139,7 +139,7 @@ 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(function()->kind()) || locals_count == 0);
+ DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0);
if (locals_count == 1) {
__ push(Immediate(isolate()->factory()->undefined_value()));
} else if (locals_count > 1) {
@@ -318,7 +318,7 @@ void FullCodeGenerator::Generate() {
ArgumentsAccessStub::Type type;
if (is_strict(language_mode()) || !has_simple_parameters()) {
type = ArgumentsAccessStub::NEW_STRICT;
- } else if (function()->has_duplicate_parameters()) {
+ } else if (literal()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
} else {
type = ArgumentsAccessStub::NEW_SLOPPY_FAST;
@@ -364,7 +364,7 @@ void FullCodeGenerator::Generate() {
{ Comment cmnt(masm_, "[ Body");
DCHECK(loop_depth() == 0);
- VisitStatements(function()->body());
+ VisitStatements(literal()->body());
DCHECK(loop_depth() == 0);
}
}
@@ -457,7 +457,7 @@ void FullCodeGenerator::EmitReturnSequence() {
EmitProfilingCounterReset();
__ bind(&ok);
- SetReturnPosition(function());
+ SetReturnPosition(literal());
int no_frame_start = masm_->pc_offset();
__ leave();
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.