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

Side by Side Diff: src/type-feedback-vector.cc

Issue 2620753003: [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)
Patch Set: Compile fix. Created 3 years, 11 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/type-feedback-vector.h" 5 #include "src/type-feedback-vector.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/ic/ic-inl.h" 8 #include "src/ic/ic-inl.h"
9 #include "src/ic/ic-state.h" 9 #include "src/ic/ic-state.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 int entry_size = TypeFeedbackMetadata::GetSlotSize(kind); 245 int entry_size = TypeFeedbackMetadata::GetSlotSize(kind);
246 246
247 if (kind == FeedbackVectorSlotKind::CREATE_CLOSURE) { 247 if (kind == FeedbackVectorSlotKind::CREATE_CLOSURE) {
248 // This fixed array is filled with undefined. 248 // This fixed array is filled with undefined.
249 int length = metadata->GetParameter(parameter_index++); 249 int length = metadata->GetParameter(parameter_index++);
250 if (length == 0) { 250 if (length == 0) {
251 // This is a native function literal. We can always point to 251 // This is a native function literal. We can always point to
252 // the empty literals array here. 252 // the empty literals array here.
253 array->set(index, *factory->empty_literals_array(), SKIP_WRITE_BARRIER); 253 array->set(index, *factory->empty_literals_array(), SKIP_WRITE_BARRIER);
254 } else { 254 } else {
255 // TODO(mvstanton): Create the array. 255 Handle<FixedArray> value = factory->NewFixedArray(length);
256 // Handle<FixedArray> value = factory->NewFixedArray(length); 256 array->set(index, *value);
257 // array->set(index, *value);
258 array->set(index, *factory->empty_literals_array(), SKIP_WRITE_BARRIER);
259 } 257 }
260 } 258 }
261 i += entry_size; 259 i += entry_size;
262 } 260 }
263 261
264 DisallowHeapAllocation no_gc; 262 DisallowHeapAllocation no_gc;
265 263
266 // Ensure we can skip the write barrier 264 // Ensure we can skip the write barrier
267 Handle<Object> uninitialized_sentinel = UninitializedSentinel(isolate); 265 Handle<Object> uninitialized_sentinel = UninitializedSentinel(isolate);
268 DCHECK_EQ(isolate->heap()->uninitialized_symbol(), *uninitialized_sentinel); 266 DCHECK_EQ(isolate->heap()->uninitialized_symbol(), *uninitialized_sentinel);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: 369 case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC:
372 case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: { 370 case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: {
373 DCHECK(Get(slot)->IsSmi()); 371 DCHECK(Get(slot)->IsSmi());
374 // don't clear these smi slots. 372 // don't clear these smi slots.
375 // Set(slot, Smi::kZero); 373 // Set(slot, Smi::kZero);
376 break; 374 break;
377 } 375 }
378 case FeedbackVectorSlotKind::CREATE_CLOSURE: { 376 case FeedbackVectorSlotKind::CREATE_CLOSURE: {
379 // Fill the array with undefined. 377 // Fill the array with undefined.
380 FixedArray* array = FixedArray::cast(Get(slot)); 378 FixedArray* array = FixedArray::cast(Get(slot));
379 // TODO(mvstanton): explain the 1 below!
381 for (int i = 1; i < array->length(); i++) { 380 for (int i = 1; i < array->length(); i++) {
382 array->set_undefined(i); 381 array->set_undefined(i);
383 } 382 }
384 break; 383 break;
385 } 384 }
386 case FeedbackVectorSlotKind::GENERAL: { 385 case FeedbackVectorSlotKind::GENERAL: {
387 if (obj->IsHeapObject()) { 386 if (obj->IsHeapObject()) {
388 InstanceType instance_type = 387 InstanceType instance_type =
389 HeapObject::cast(obj)->map()->instance_type(); 388 HeapObject::cast(obj)->map()->instance_type();
390 // AllocationSites are exempt from clearing. They don't store Maps 389 // AllocationSites are exempt from clearing. They don't store Maps
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 void StoreDataPropertyInLiteralICNexus::ConfigureMonomorphic( 1088 void StoreDataPropertyInLiteralICNexus::ConfigureMonomorphic(
1090 Handle<Name> name, Handle<Map> receiver_map) { 1089 Handle<Name> name, Handle<Map> receiver_map) {
1091 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); 1090 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
1092 1091
1093 SetFeedback(*cell); 1092 SetFeedback(*cell);
1094 SetFeedbackExtra(*name); 1093 SetFeedbackExtra(*name);
1095 } 1094 }
1096 1095
1097 } // namespace internal 1096 } // namespace internal
1098 } // namespace v8 1097 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698