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

Side by Side Diff: src/debug/liveedit.cc

Issue 2680313002: Count closures using the feedback vector cell map, specialize if count==1. (Closed)
Patch Set: Only specialize if compiling from bytecode Created 3 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/compiler/pipeline.cc ('k') | src/factory.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/debug/liveedit.h" 5 #include "src/debug/liveedit.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compilation-cache.h" 9 #include "src/compilation-cache.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 int new_literal_count = compile_info_wrapper->GetLiteralCount(); 754 int new_literal_count = compile_info_wrapper->GetLiteralCount();
755 755
756 // When feedback metadata changes, we have to create new array instances. 756 // When feedback metadata changes, we have to create new array instances.
757 // Since we cannot create instances when iterating heap, we should first 757 // Since we cannot create instances when iterating heap, we should first
758 // collect all functions and fix their literal arrays. 758 // collect all functions and fix their literal arrays.
759 Handle<FixedArray> function_instances = 759 Handle<FixedArray> function_instances =
760 CollectJSFunctions(shared_info, isolate); 760 CollectJSFunctions(shared_info, isolate);
761 761
762 for (int i = 0; i < function_instances->length(); i++) { 762 for (int i = 0; i < function_instances->length(); i++) {
763 Handle<JSFunction> fun(JSFunction::cast(function_instances->get(i))); 763 Handle<JSFunction> fun(JSFunction::cast(function_instances->get(i)));
764 fun->set_feedback_vector_cell(isolate->heap()->undefined_cell()); 764 Handle<Cell> new_cell = isolate->factory()->NewManyClosuresCell(
765 isolate->factory()->undefined_value());
766 fun->set_feedback_vector_cell(*new_cell);
765 // Only create feedback vectors if we already have the metadata. 767 // Only create feedback vectors if we already have the metadata.
766 if (shared_info->is_compiled()) JSFunction::EnsureLiterals(fun); 768 if (shared_info->is_compiled()) JSFunction::EnsureLiterals(fun);
767 } 769 }
768 770
769 shared_info->set_num_literals(new_literal_count); 771 shared_info->set_num_literals(new_literal_count);
770 } 772 }
771 773
772 private: 774 private:
773 // Iterates all function instances in the HEAP that refers to the 775 // Iterates all function instances in the HEAP that refers to the
774 // provided shared_info. 776 // provided shared_info.
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 scope_info_length++; 1648 scope_info_length++;
1647 1649
1648 current_scope = current_scope->outer_scope(); 1650 current_scope = current_scope->outer_scope();
1649 } 1651 }
1650 1652
1651 return scope_info_list; 1653 return scope_info_list;
1652 } 1654 }
1653 1655
1654 } // namespace internal 1656 } // namespace internal
1655 } // namespace v8 1657 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698