| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index 48fa124e2081221688c840cc5c616d5672972fe3..64225b91cbf6ef711de11eab16244a6d6d43f41b 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -12344,22 +12344,6 @@
|
| // No write barrier required, since the builtin is part of the root set.
|
| }
|
|
|
| -// static
|
| -Handle<LiteralsArray> SharedFunctionInfo::FindOrCreateLiterals(
|
| - Handle<SharedFunctionInfo> shared, Handle<Context> native_context) {
|
| - Isolate* isolate = shared->GetIsolate();
|
| - CodeAndLiterals result =
|
| - shared->SearchOptimizedCodeMap(*native_context, BailoutId::None());
|
| - if (result.literals != nullptr) {
|
| - return handle(result.literals, isolate);
|
| - }
|
| - Handle<TypeFeedbackVector> feedback_vector =
|
| - TypeFeedbackVector::New(isolate, handle(shared->feedback_metadata()));
|
| - Handle<LiteralsArray> literals = LiteralsArray::New(
|
| - isolate, feedback_vector, shared->num_literals(), TENURED);
|
| - AddLiteralsToOptimizedCodeMap(shared, native_context, literals);
|
| - return literals;
|
| -}
|
|
|
| void SharedFunctionInfo::AddSharedCodeToOptimizedCodeMap(
|
| Handle<SharedFunctionInfo> shared, Handle<Code> code) {
|
| @@ -12563,14 +12547,6 @@
|
| }
|
| }
|
|
|
| -// static
|
| -void JSFunction::EnsureLiterals(Handle<JSFunction> function) {
|
| - Handle<SharedFunctionInfo> shared(function->shared());
|
| - Handle<Context> native_context(function->context()->native_context());
|
| - Handle<LiteralsArray> literals =
|
| - SharedFunctionInfo::FindOrCreateLiterals(shared, native_context);
|
| - function->set_literals(*literals);
|
| -}
|
|
|
| static void GetMinInobjectSlack(Map* map, void* data) {
|
| int slack = map->unused_property_fields();
|
| @@ -13848,6 +13824,9 @@
|
|
|
| void SharedFunctionInfo::ResetForNewContext(int new_ic_age) {
|
| code()->ClearInlineCaches();
|
| + // If we clear ICs, we need to clear the type feedback vector too, since
|
| + // CallICs are synced with a feedback vector slot.
|
| + ClearTypeFeedbackInfo();
|
| set_ic_age(new_ic_age);
|
| if (code()->kind() == Code::FUNCTION) {
|
| code()->set_profiler_ticks(0);
|
| @@ -13886,19 +13865,6 @@
|
| return -1;
|
| }
|
|
|
| -void SharedFunctionInfo::ClearCodeFromOptimizedCodeMap() {
|
| - if (!OptimizedCodeMapIsCleared()) {
|
| - FixedArray* optimized_code_map = this->optimized_code_map();
|
| - int length = optimized_code_map->length();
|
| - WeakCell* empty_weak_cell = GetHeap()->empty_weak_cell();
|
| - for (int i = kEntriesStart; i < length; i += kEntryLength) {
|
| - optimized_code_map->set(i + kCachedCodeOffset, empty_weak_cell,
|
| - SKIP_WRITE_BARRIER);
|
| - }
|
| - optimized_code_map->set(kSharedCodeIndex, empty_weak_cell,
|
| - SKIP_WRITE_BARRIER);
|
| - }
|
| -}
|
|
|
| CodeAndLiterals SharedFunctionInfo::SearchOptimizedCodeMap(
|
| Context* native_context, BailoutId osr_ast_id) {
|
| @@ -14337,12 +14303,14 @@
|
| }
|
| }
|
|
|
| -void JSFunction::ClearTypeFeedbackInfo() {
|
| - feedback_vector()->ClearSlots(shared());
|
| -}
|
| -
|
| -void JSFunction::ClearTypeFeedbackInfoAtGCTime() {
|
| - feedback_vector()->ClearSlotsAtGCTime(shared());
|
| +
|
| +void SharedFunctionInfo::ClearTypeFeedbackInfo() {
|
| + feedback_vector()->ClearSlots(this);
|
| +}
|
| +
|
| +
|
| +void SharedFunctionInfo::ClearTypeFeedbackInfoAtGCTime() {
|
| + feedback_vector()->ClearSlotsAtGCTime(this);
|
| }
|
|
|
|
|
|
|