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

Side by Side Diff: src/compiler.cc

Issue 1876973002: Reland of [compiler] Make feedback vector cope with flag changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | test/mjsunit/regress/regress-crbug-600995.js » ('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/compiler.h" 5 #include "src/compiler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/ast/ast-numbering.h" 9 #include "src/ast/ast-numbering.h"
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 PROFILE(info->isolate(), 737 PROFILE(info->isolate(),
738 CodeCreateEvent(log_tag, *abstract_code, *shared, info, script_name, 738 CodeCreateEvent(log_tag, *abstract_code, *shared, info, script_name,
739 line_num, column_num)); 739 line_num, column_num));
740 } 740 }
741 } 741 }
742 742
743 void EnsureFeedbackVector(CompilationInfo* info) { 743 void EnsureFeedbackVector(CompilationInfo* info) {
744 if (!info->has_shared_info()) return; 744 if (!info->has_shared_info()) return;
745 745
746 // If no type feedback vector exists, we create one now. At this point the 746 // If no type feedback vector exists, we create one now. At this point the
747 // AstNumbering pass has already run. Note that we should reuse any existing 747 // AstNumbering pass has already run. Note the snapshot can contain outdated
748 // feedback vector rather than creating a new one. 748 // vectors for a different configuration, hence we also recreate a new vector
749 if (info->shared_info()->feedback_vector()->is_empty()) { 749 // when the function is not compiled (i.e. no code was serialized).
750 if (info->shared_info()->feedback_vector()->is_empty() ||
751 !info->shared_info()->is_compiled()) {
750 Handle<TypeFeedbackMetadata> feedback_metadata = TypeFeedbackMetadata::New( 752 Handle<TypeFeedbackMetadata> feedback_metadata = TypeFeedbackMetadata::New(
751 info->isolate(), info->literal()->feedback_vector_spec()); 753 info->isolate(), info->literal()->feedback_vector_spec());
752 Handle<TypeFeedbackVector> feedback_vector = 754 Handle<TypeFeedbackVector> feedback_vector =
753 TypeFeedbackVector::New(info->isolate(), feedback_metadata); 755 TypeFeedbackVector::New(info->isolate(), feedback_metadata);
754 info->shared_info()->set_feedback_vector(*feedback_vector); 756 info->shared_info()->set_feedback_vector(*feedback_vector);
755 } 757 }
756 758
757 // It's very important that recompiles do not alter the structure of the type 759 // It's very important that recompiles do not alter the structure of the type
758 // feedback vector. Verify that the structure fits the function literal. 760 // feedback vector. Verify that the structure fits the function literal.
759 CHECK(!info->shared_info()->feedback_vector()->metadata()->SpecDiffersFrom( 761 CHECK(!info->shared_info()->feedback_vector()->metadata()->SpecDiffersFrom(
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 MaybeHandle<Code> code; 1900 MaybeHandle<Code> code;
1899 if (cached.code != nullptr) code = handle(cached.code); 1901 if (cached.code != nullptr) code = handle(cached.code);
1900 Handle<Context> native_context(function->context()->native_context()); 1902 Handle<Context> native_context(function->context()->native_context());
1901 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, 1903 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code,
1902 literals, BailoutId::None()); 1904 literals, BailoutId::None());
1903 } 1905 }
1904 } 1906 }
1905 1907
1906 } // namespace internal 1908 } // namespace internal
1907 } // namespace v8 1909 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-600995.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698