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

Unified Diff: src/factory.cc

Issue 1670813005: Revert of Type Feedback Vector lives in the closure (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index ca723385374bf6865b711d807cab08891a569a0f..3d094c9cb25fd5ffaf7f18c1fa3f22b6e607dcc1 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1205,7 +1205,7 @@
function->set_code(info->code());
function->set_context(*context);
function->set_prototype_or_initial_map(*the_hole_value());
- function->set_literals(LiteralsArray::cast(*empty_literals_array()));
+ function->set_literals(LiteralsArray::cast(*empty_fixed_array()));
function->set_next_function_link(*undefined_value(), SKIP_WRITE_BARRIER);
isolate()->heap()->InitializeJSObjectBody(*function, *map, JSFunction::kSize);
return function;
@@ -1371,12 +1371,11 @@
if (cached.literals != nullptr) {
result->set_literals(cached.literals);
- } else if (info->is_compiled()) {
+ } else {
int number_of_literals = info->num_literals();
- Handle<TypeFeedbackVector> vector =
- TypeFeedbackVector::New(isolate(), handle(info->feedback_metadata()));
Handle<LiteralsArray> literals =
- LiteralsArray::New(isolate(), vector, number_of_literals, pretenure);
+ LiteralsArray::New(isolate(), handle(info->feedback_vector()),
+ number_of_literals, pretenure);
result->set_literals(*literals);
// Cache context-specific literals.
@@ -2082,15 +2081,16 @@
object->set_hash(*hash);
}
+
Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
Handle<String> name, int number_of_literals, FunctionKind kind,
Handle<Code> code, Handle<ScopeInfo> scope_info,
- Handle<TypeFeedbackMetadata> feedback_metadata) {
+ Handle<TypeFeedbackVector> feedback_vector) {
DCHECK(IsValidFunctionKind(kind));
Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(
name, code, IsConstructable(kind, scope_info->language_mode()));
shared->set_scope_info(*scope_info);
- shared->set_feedback_metadata(*feedback_metadata);
+ shared->set_feedback_vector(*feedback_vector);
shared->set_kind(kind);
shared->set_num_literals(number_of_literals);
if (IsGeneratorFunction(kind)) {
@@ -2146,7 +2146,9 @@
StaticFeedbackVectorSpec empty_spec;
Handle<TypeFeedbackMetadata> feedback_metadata =
TypeFeedbackMetadata::New(isolate(), &empty_spec);
- share->set_feedback_metadata(*feedback_metadata, SKIP_WRITE_BARRIER);
+ Handle<TypeFeedbackVector> feedback_vector =
+ TypeFeedbackVector::New(isolate(), feedback_metadata);
+ share->set_feedback_vector(*feedback_vector, SKIP_WRITE_BARRIER);
#if TRACE_MAPS
share->set_unique_id(isolate()->GetNextUniqueSharedFunctionInfoId());
#endif
« no previous file with comments | « src/factory.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698