Commit 153dde4f authored by neis's avatar neis Committed by Commit bot

[interpreter] Use clearer names for context related functions.

R=rmcilroy@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2331913002
Cr-Commit-Position: refs/heads/master@{#39344}
parent 278b9f80
......@@ -745,9 +745,9 @@ void BytecodeGenerator::GenerateBytecode(uintptr_t stack_limit) {
if (scope()->NeedsContext()) {
// Push a new inner context scope for the function.
VisitNewLocalFunctionContext();
BuildNewLocalActivationContext();
ContextScope local_function_context(this, scope(), false);
VisitBuildLocalActivationContext();
BuildLocalActivationContextInitialization();
GenerateBytecodeBody();
} else {
GenerateBytecodeBody();
......@@ -879,7 +879,7 @@ void BytecodeGenerator::VisitGeneratorPrologue() {
void BytecodeGenerator::VisitBlock(Block* stmt) {
// Visit declarations and statements.
if (stmt->scope() != nullptr && stmt->scope()->NeedsContext()) {
VisitNewLocalBlockContext(stmt->scope());
BuildNewLocalBlockContext(stmt->scope());
ContextScope scope(this, stmt->scope());
VisitBlockDeclarationsAndStatements(stmt);
} else {
......@@ -1096,7 +1096,7 @@ void BytecodeGenerator::VisitReturnStatement(ReturnStatement* stmt) {
void BytecodeGenerator::VisitWithStatement(WithStatement* stmt) {
builder()->SetStatementPosition(stmt);
VisitForAccumulatorValue(stmt->expression());
VisitNewLocalWithContext(stmt->scope());
BuildNewLocalWithContext(stmt->scope());
VisitInScope(stmt->statement(), stmt->scope());
}
......@@ -1389,7 +1389,7 @@ void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
try_control_builder.EndTry();
// Create a catch scope that binds the exception.
VisitNewLocalCatchContext(stmt->variable(), stmt->scope());
BuildNewLocalCatchContext(stmt->variable(), stmt->scope());
builder()->StoreAccumulatorInRegister(context);
// If requested, clear message object as we enter the catch block.
......@@ -3173,7 +3173,7 @@ void BytecodeGenerator::VisitRewritableExpression(RewritableExpression* expr) {
Visit(expr->expression());
}
void BytecodeGenerator::VisitNewLocalFunctionContext() {
void BytecodeGenerator::BuildNewLocalActivationContext() {
AccumulatorResultScope accumulator_execution_result(this);
Scope* scope = this->scope();
......@@ -3214,7 +3214,7 @@ void BytecodeGenerator::VisitNewLocalFunctionContext() {
execution_result()->SetResultInAccumulator();
}
void BytecodeGenerator::VisitBuildLocalActivationContext() {
void BytecodeGenerator::BuildLocalActivationContextInitialization() {
DeclarationScope* scope = this->scope();
if (scope->has_this_declaration() && scope->receiver()->IsContextSlot()) {
......@@ -3242,7 +3242,7 @@ void BytecodeGenerator::VisitBuildLocalActivationContext() {
}
}
void BytecodeGenerator::VisitNewLocalBlockContext(Scope* scope) {
void BytecodeGenerator::BuildNewLocalBlockContext(Scope* scope) {
AccumulatorResultScope accumulator_execution_result(this);
DCHECK(scope->is_block_scope());
......@@ -3251,7 +3251,7 @@ void BytecodeGenerator::VisitNewLocalBlockContext(Scope* scope) {
execution_result()->SetResultInAccumulator();
}
void BytecodeGenerator::VisitNewLocalWithContext(Scope* scope) {
void BytecodeGenerator::BuildNewLocalWithContext(Scope* scope) {
AccumulatorResultScope accumulator_execution_result(this);
Register extension_object = register_allocator()->NewRegister();
......@@ -3262,7 +3262,7 @@ void BytecodeGenerator::VisitNewLocalWithContext(Scope* scope) {
execution_result()->SetResultInAccumulator();
}
void BytecodeGenerator::VisitNewLocalCatchContext(Variable* variable,
void BytecodeGenerator::BuildNewLocalCatchContext(Variable* variable,
Scope* scope) {
AccumulatorResultScope accumulator_execution_result(this);
DCHECK(variable->IsContextSlot());
......
......@@ -125,6 +125,12 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void BuildIndexedJump(Register value, size_t start_index, size_t size,
ZoneVector<BytecodeLabel>& targets);
void BuildNewLocalActivationContext();
void BuildLocalActivationContextInitialization();
void BuildNewLocalBlockContext(Scope* scope);
void BuildNewLocalCatchContext(Variable* variable, Scope* scope);
void BuildNewLocalWithContext(Scope* scope);
void VisitGeneratorPrologue();
void VisitArgumentsObject(Variable* variable);
......@@ -136,12 +142,7 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void VisitClassLiteralStaticPrototypeWithComputedName(Register name);
void VisitThisFunctionVariable(Variable* variable);
void VisitNewTargetVariable(Variable* variable);
void VisitNewLocalFunctionContext();
void VisitBuildLocalActivationContext();
void VisitBlockDeclarationsAndStatements(Block* stmt);
void VisitNewLocalBlockContext(Scope* scope);
void VisitNewLocalCatchContext(Variable* variable, Scope* scope);
void VisitNewLocalWithContext(Scope* scope);
void VisitFunctionClosureForContext();
void VisitSetHomeObject(Register value, Register home_object,
LiteralProperty* property, int slot_number = 0);
......
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