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

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

Issue 1668103002: Type Feedback Vector lives in the closure (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/crankshaft/typing.cc » ('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 <sstream> 7 #include <sstream>
8 8
9 #include "src/allocation-site-scopes.h" 9 #include "src/allocation-site-scopes.h"
10 #include "src/ast/ast-numbering.h" 10 #include "src/ast/ast-numbering.h"
(...skipping 5520 matching lines...) Expand 10 before | Expand all | Expand 10 after
5531 5531
5532 void HOptimizedGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) { 5532 void HOptimizedGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) {
5533 DCHECK(!HasStackOverflow()); 5533 DCHECK(!HasStackOverflow());
5534 DCHECK(current_block() != NULL); 5534 DCHECK(current_block() != NULL);
5535 DCHECK(current_block()->HasPredecessor()); 5535 DCHECK(current_block()->HasPredecessor());
5536 Handle<SharedFunctionInfo> shared_info = Compiler::GetSharedFunctionInfo( 5536 Handle<SharedFunctionInfo> shared_info = Compiler::GetSharedFunctionInfo(
5537 expr, current_info()->script(), top_info()); 5537 expr, current_info()->script(), top_info());
5538 // We also have a stack overflow if the recursive compilation did. 5538 // We also have a stack overflow if the recursive compilation did.
5539 if (HasStackOverflow()) return; 5539 if (HasStackOverflow()) return;
5540 // Use the fast case closure allocation code that allocates in new 5540 // Use the fast case closure allocation code that allocates in new
5541 // space for nested functions that don't need literals cloning. 5541 // space for nested functions that don't need pretenuring.
5542 HConstant* shared_info_value = Add<HConstant>(shared_info); 5542 HConstant* shared_info_value = Add<HConstant>(shared_info);
5543 HInstruction* instr; 5543 HInstruction* instr;
5544 if (!expr->pretenure() && shared_info->num_literals() == 0) { 5544 if (!expr->pretenure()) {
5545 FastNewClosureStub stub(isolate(), shared_info->language_mode(), 5545 FastNewClosureStub stub(isolate(), shared_info->language_mode(),
5546 shared_info->kind()); 5546 shared_info->kind());
5547 FastNewClosureDescriptor descriptor(isolate()); 5547 FastNewClosureDescriptor descriptor(isolate());
5548 HValue* values[] = {context(), shared_info_value}; 5548 HValue* values[] = {context(), shared_info_value};
5549 HConstant* stub_value = Add<HConstant>(stub.GetCode()); 5549 HConstant* stub_value = Add<HConstant>(stub.GetCode());
5550 instr = New<HCallWithDescriptor>(stub_value, 0, descriptor, 5550 instr = New<HCallWithDescriptor>(stub_value, 0, descriptor,
5551 Vector<HValue*>(values, arraysize(values)), 5551 Vector<HValue*>(values, arraysize(values)),
5552 NORMAL_CALL); 5552 NORMAL_CALL);
5553 } else { 5553 } else {
5554 Add<HPushArguments>(shared_info_value); 5554 Add<HPushArguments>(shared_info_value);
(...skipping 2917 matching lines...) Expand 10 before | Expand all | Expand 10 after
8472 // the target function if we don't already have it. 8472 // the target function if we don't already have it.
8473 if (!Compiler::EnsureDeoptimizationSupport(&target_info)) { 8473 if (!Compiler::EnsureDeoptimizationSupport(&target_info)) {
8474 TraceInline(target, caller, "could not generate deoptimization info"); 8474 TraceInline(target, caller, "could not generate deoptimization info");
8475 return false; 8475 return false;
8476 } 8476 }
8477 // Remember that we inlined this function. This needs to be called right 8477 // Remember that we inlined this function. This needs to be called right
8478 // after the EnsureDeoptimizationSupport call so that the code flusher 8478 // after the EnsureDeoptimizationSupport call so that the code flusher
8479 // does not remove the code with the deoptimization support. 8479 // does not remove the code with the deoptimization support.
8480 top_info()->AddInlinedFunction(target_info.shared_info()); 8480 top_info()->AddInlinedFunction(target_info.shared_info());
8481 8481
8482 // If target was lazily compiled, it's literals array may not yet be set up.
8483 JSFunction::EnsureLiterals(target);
8484
8482 // ---------------------------------------------------------------- 8485 // ----------------------------------------------------------------
8483 // After this point, we've made a decision to inline this function (so 8486 // After this point, we've made a decision to inline this function (so
8484 // TryInline should always return true). 8487 // TryInline should always return true).
8485 8488
8486 // Type-check the inlined function. 8489 // Type-check the inlined function.
8487 DCHECK(target_shared->has_deoptimization_support()); 8490 DCHECK(target_shared->has_deoptimization_support());
8488 AstTyper(target_info.isolate(), target_info.zone(), target_info.closure(), 8491 AstTyper(target_info.isolate(), target_info.zone(), target_info.closure(),
8489 target_info.scope(), target_info.osr_ast_id(), target_info.literal()) 8492 target_info.scope(), target_info.osr_ast_id(), target_info.literal())
8490 .Run(); 8493 .Run();
8491 8494
(...skipping 5163 matching lines...) Expand 10 before | Expand all | Expand 10 after
13655 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13658 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13656 } 13659 }
13657 13660
13658 #ifdef DEBUG 13661 #ifdef DEBUG
13659 graph_->Verify(false); // No full verify. 13662 graph_->Verify(false); // No full verify.
13660 #endif 13663 #endif
13661 } 13664 }
13662 13665
13663 } // namespace internal 13666 } // namespace internal
13664 } // namespace v8 13667 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/crankshaft/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698