Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: src/typing.cc

Issue 1318823010: Eliminate use of CompilationInfo in several AstVisitor descendants. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: revised Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/typing.h ('k') | src/typing-reset.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/typing.cc
diff --git a/src/typing.cc b/src/typing.cc
index b2b60bde2c7a39dcf2ac56f54fedee8edf2e0237..fb758828b076524a47c6be702050437507d4be95 100644
--- a/src/typing.cc
+++ b/src/typing.cc
@@ -15,14 +15,17 @@ namespace v8 {
namespace internal {
-AstTyper::AstTyper(CompilationInfo* info)
- : info_(info),
- oracle_(info->isolate(), info->zone(),
- handle(info->closure()->shared()->code()),
- handle(info->closure()->shared()->feedback_vector()),
- handle(info->closure()->context()->native_context())),
- store_(info->zone()) {
- InitializeAstVisitor(info->isolate(), info->zone());
+AstTyper::AstTyper(Isolate* isolate, Zone* zone, Handle<JSFunction> closure,
+ Scope* scope, BailoutId osr_ast_id, FunctionLiteral* root)
+ : closure_(closure),
+ scope_(scope),
+ osr_ast_id_(osr_ast_id),
+ root_(root),
+ oracle_(isolate, zone, handle(closure->shared()->code()),
+ handle(closure->shared()->feedback_vector()),
+ handle(closure->context()->native_context())),
+ store_(zone) {
+ InitializeAstVisitor(isolate, zone);
}
@@ -45,18 +48,17 @@ Effect AstTyper::ObservedOnStack(Object* value) {
void AstTyper::ObserveTypesAtOsrEntry(IterationStatement* stmt) {
- if (stmt->OsrEntryId() != info_->osr_ast_id()) return;
+ if (stmt->OsrEntryId() != osr_ast_id_) return;
DisallowHeapAllocation no_gc;
JavaScriptFrameIterator it(isolate());
JavaScriptFrame* frame = it.frame();
- Scope* scope = info_->scope();
// Assert that the frame on the stack belongs to the function we want to OSR.
- DCHECK_EQ(*info_->closure(), frame->function());
+ DCHECK_EQ(*closure_, frame->function());
- int params = scope->num_parameters();
- int locals = scope->StackLocalCount();
+ int params = scope_->num_parameters();
+ int locals = scope_->StackLocalCount();
// Use sequential composition to achieve desired narrowing.
// The receiver is a parameter with index -1.
@@ -71,21 +73,19 @@ void AstTyper::ObserveTypesAtOsrEntry(IterationStatement* stmt) {
#ifdef OBJECT_PRINT
if (FLAG_trace_osr && FLAG_print_scopes) {
- PrintObserved(scope->receiver(),
- frame->receiver(),
+ PrintObserved(scope_->receiver(), frame->receiver(),
store_.LookupBounds(parameter_index(-1)).lower);
for (int i = 0; i < params; i++) {
- PrintObserved(scope->parameter(i),
- frame->GetParameter(i),
+ PrintObserved(scope_->parameter(i), frame->GetParameter(i),
store_.LookupBounds(parameter_index(i)).lower);
}
ZoneList<Variable*> local_vars(locals, zone());
- ZoneList<Variable*> context_vars(scope->ContextLocalCount(), zone());
- ZoneList<Variable*> global_vars(scope->ContextGlobalCount(), zone());
- scope->CollectStackAndContextLocals(&local_vars, &context_vars,
- &global_vars);
+ ZoneList<Variable*> context_vars(scope_->ContextLocalCount(), zone());
+ ZoneList<Variable*> global_vars(scope_->ContextGlobalCount(), zone());
+ scope_->CollectStackAndContextLocals(&local_vars, &context_vars,
+ &global_vars);
for (int i = 0; i < locals; i++) {
PrintObserved(local_vars.at(i),
frame->GetExpression(i),
@@ -105,9 +105,8 @@ void AstTyper::ObserveTypesAtOsrEntry(IterationStatement* stmt) {
void AstTyper::Run() {
- Scope* scope = info_->scope();
- RECURSE(VisitDeclarations(scope->declarations()));
- RECURSE(VisitStatements(info_->literal()->body()));
+ RECURSE(VisitDeclarations(scope_->declarations()));
+ RECURSE(VisitStatements(root_->body()));
}
« no previous file with comments | « src/typing.h ('k') | src/typing-reset.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698