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

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

Issue 2457393003: Thread decls-list through Declaration (Closed)
Patch Set: rebase 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
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/crankshaft/typing.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8099 matching lines...) Expand 10 before | Expand all | Expand 10 after
8110 } 8110 }
8111 8111
8112 // Unsupported variable references present. 8112 // Unsupported variable references present.
8113 if (function->scope()->this_function_var() != nullptr || 8113 if (function->scope()->this_function_var() != nullptr ||
8114 function->scope()->new_target_var() != nullptr) { 8114 function->scope()->new_target_var() != nullptr) {
8115 TraceInline(target, caller, "target uses new target or this function"); 8115 TraceInline(target, caller, "target uses new target or this function");
8116 return false; 8116 return false;
8117 } 8117 }
8118 8118
8119 // All declarations must be inlineable. 8119 // All declarations must be inlineable.
8120 ZoneList<Declaration*>* decls = target_info.scope()->declarations(); 8120 Declaration::List* decls = target_info.scope()->declarations();
8121 int decl_count = decls->length(); 8121 for (Declaration* decl : *decls) {
8122 for (int i = 0; i < decl_count; ++i) { 8122 if (decl->IsFunctionDeclaration() ||
8123 if (decls->at(i)->IsFunctionDeclaration() || 8123 !decl->proxy()->var()->IsStackAllocated()) {
8124 !decls->at(i)->proxy()->var()->IsStackAllocated()) {
8125 TraceInline(target, caller, "target has non-trivial declaration"); 8124 TraceInline(target, caller, "target has non-trivial declaration");
8126 return false; 8125 return false;
8127 } 8126 }
8128 } 8127 }
8129 8128
8130 // Generate the deoptimization data for the unoptimized version of 8129 // Generate the deoptimization data for the unoptimized version of
8131 // the target function if we don't already have it. 8130 // the target function if we don't already have it.
8132 if (!Compiler::EnsureDeoptimizationSupport(&target_info)) { 8131 if (!Compiler::EnsureDeoptimizationSupport(&target_info)) {
8133 TraceInline(target, caller, "could not generate deoptimization info"); 8132 TraceInline(target, caller, "could not generate deoptimization info");
8134 return false; 8133 return false;
(...skipping 3679 matching lines...) Expand 10 before | Expand all | Expand 10 after
11814 } 11813 }
11815 11814
11816 11815
11817 void HOptimizedGraphBuilder::VisitSuperCallReference(SuperCallReference* expr) { 11816 void HOptimizedGraphBuilder::VisitSuperCallReference(SuperCallReference* expr) {
11818 DCHECK(!HasStackOverflow()); 11817 DCHECK(!HasStackOverflow());
11819 DCHECK(current_block() != NULL); 11818 DCHECK(current_block() != NULL);
11820 DCHECK(current_block()->HasPredecessor()); 11819 DCHECK(current_block()->HasPredecessor());
11821 return Bailout(kSuperReference); 11820 return Bailout(kSuperReference);
11822 } 11821 }
11823 11822
11824
11825 void HOptimizedGraphBuilder::VisitDeclarations( 11823 void HOptimizedGraphBuilder::VisitDeclarations(
11826 ZoneList<Declaration*>* declarations) { 11824 Declaration::List* declarations) {
11827 DCHECK(globals_.is_empty()); 11825 DCHECK(globals_.is_empty());
11828 AstVisitor<HOptimizedGraphBuilder>::VisitDeclarations(declarations); 11826 AstVisitor<HOptimizedGraphBuilder>::VisitDeclarations(declarations);
11829 if (!globals_.is_empty()) { 11827 if (!globals_.is_empty()) {
11830 Handle<FixedArray> array = 11828 Handle<FixedArray> array =
11831 isolate()->factory()->NewFixedArray(globals_.length(), TENURED); 11829 isolate()->factory()->NewFixedArray(globals_.length(), TENURED);
11832 for (int i = 0; i < globals_.length(); ++i) array->set(i, *globals_.at(i)); 11830 for (int i = 0; i < globals_.length(); ++i) array->set(i, *globals_.at(i));
11833 int flags = current_info()->GetDeclareGlobalsFlags(); 11831 int flags = current_info()->GetDeclareGlobalsFlags();
11834 Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate()); 11832 Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
11835 Add<HDeclareGlobals>(array, flags, vector); 11833 Add<HDeclareGlobals>(array, flags, vector);
11836 globals_.Rewind(0); 11834 globals_.Rewind(0);
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
13035 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13033 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13036 } 13034 }
13037 13035
13038 #ifdef DEBUG 13036 #ifdef DEBUG
13039 graph_->Verify(false); // No full verify. 13037 graph_->Verify(false); // No full verify.
13040 #endif 13038 #endif
13041 } 13039 }
13042 13040
13043 } // namespace internal 13041 } // namespace internal
13044 } // namespace v8 13042 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/crankshaft/typing.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698