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

Side by Side Diff: src/crankshaft/hydrogen.cc

Issue 2457393003: Thread decls-list through Declaration (Closed)
Patch Set: rename Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/hydrogen.h" 5 #include "src/crankshaft/hydrogen.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 8059 matching lines...) Expand 10 before | Expand all | Expand 10 after
8070 } 8070 }
8071 8071
8072 // Unsupported variable references present. 8072 // Unsupported variable references present.
8073 if (function->scope()->this_function_var() != nullptr || 8073 if (function->scope()->this_function_var() != nullptr ||
8074 function->scope()->new_target_var() != nullptr) { 8074 function->scope()->new_target_var() != nullptr) {
8075 TraceInline(target, caller, "target uses new target or this function"); 8075 TraceInline(target, caller, "target uses new target or this function");
8076 return false; 8076 return false;
8077 } 8077 }
8078 8078
8079 // All declarations must be inlineable. 8079 // All declarations must be inlineable.
8080 ZoneList<Declaration*>* decls = target_info.scope()->declarations(); 8080 Declaration::List* decls = target_info.scope()->declarations();
8081 int decl_count = decls->length(); 8081 for (Declaration* decl : *decls) {
8082 for (int i = 0; i < decl_count; ++i) { 8082 if (decl->IsFunctionDeclaration() ||
8083 if (decls->at(i)->IsFunctionDeclaration() || 8083 !decl->proxy()->var()->IsStackAllocated()) {
8084 !decls->at(i)->proxy()->var()->IsStackAllocated()) {
8085 TraceInline(target, caller, "target has non-trivial declaration"); 8084 TraceInline(target, caller, "target has non-trivial declaration");
8086 return false; 8085 return false;
8087 } 8086 }
8088 } 8087 }
8089 8088
8090 // Generate the deoptimization data for the unoptimized version of 8089 // Generate the deoptimization data for the unoptimized version of
8091 // the target function if we don't already have it. 8090 // the target function if we don't already have it.
8092 if (!Compiler::EnsureDeoptimizationSupport(&target_info)) { 8091 if (!Compiler::EnsureDeoptimizationSupport(&target_info)) {
8093 TraceInline(target, caller, "could not generate deoptimization info"); 8092 TraceInline(target, caller, "could not generate deoptimization info");
8094 return false; 8093 return false;
(...skipping 3679 matching lines...) Expand 10 before | Expand all | Expand 10 after
11774 } 11773 }
11775 11774
11776 11775
11777 void HOptimizedGraphBuilder::VisitSuperCallReference(SuperCallReference* expr) { 11776 void HOptimizedGraphBuilder::VisitSuperCallReference(SuperCallReference* expr) {
11778 DCHECK(!HasStackOverflow()); 11777 DCHECK(!HasStackOverflow());
11779 DCHECK(current_block() != NULL); 11778 DCHECK(current_block() != NULL);
11780 DCHECK(current_block()->HasPredecessor()); 11779 DCHECK(current_block()->HasPredecessor());
11781 return Bailout(kSuperReference); 11780 return Bailout(kSuperReference);
11782 } 11781 }
11783 11782
11784
11785 void HOptimizedGraphBuilder::VisitDeclarations( 11783 void HOptimizedGraphBuilder::VisitDeclarations(
11786 ZoneList<Declaration*>* declarations) { 11784 Declaration::List* declarations) {
11787 DCHECK(globals_.is_empty()); 11785 DCHECK(globals_.is_empty());
11788 AstVisitor<HOptimizedGraphBuilder>::VisitDeclarations(declarations); 11786 AstVisitor<HOptimizedGraphBuilder>::VisitDeclarations(declarations);
11789 if (!globals_.is_empty()) { 11787 if (!globals_.is_empty()) {
11790 Handle<FixedArray> array = 11788 Handle<FixedArray> array =
11791 isolate()->factory()->NewFixedArray(globals_.length(), TENURED); 11789 isolate()->factory()->NewFixedArray(globals_.length(), TENURED);
11792 for (int i = 0; i < globals_.length(); ++i) array->set(i, *globals_.at(i)); 11790 for (int i = 0; i < globals_.length(); ++i) array->set(i, *globals_.at(i));
11793 int flags = current_info()->GetDeclareGlobalsFlags(); 11791 int flags = current_info()->GetDeclareGlobalsFlags();
11794 Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate()); 11792 Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
11795 Add<HDeclareGlobals>(array, flags, vector); 11793 Add<HDeclareGlobals>(array, flags, vector);
11796 globals_.Rewind(0); 11794 globals_.Rewind(0);
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
12995 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12993 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12996 } 12994 }
12997 12995
12998 #ifdef DEBUG 12996 #ifdef DEBUG
12999 graph_->Verify(false); // No full verify. 12997 graph_->Verify(false); // No full verify.
13000 #endif 12998 #endif
13001 } 12999 }
13002 13000
13003 } // namespace internal 13001 } // namespace internal
13004 } // namespace v8 13002 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698