OLD | NEW |
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 } | 240 } |
241 | 241 |
242 Handle<FixedArray> array = factory->NewFixedArray(length, TENURED); | 242 Handle<FixedArray> array = factory->NewFixedArray(length, TENURED); |
243 array->set(kMetadataIndex, *metadata); | 243 array->set(kMetadataIndex, *metadata); |
244 array->set(kInvocationCountIndex, Smi::kZero); | 244 array->set(kInvocationCountIndex, Smi::kZero); |
245 | 245 |
246 DisallowHeapAllocation no_gc; | 246 DisallowHeapAllocation no_gc; |
247 | 247 |
248 // Ensure we can skip the write barrier | 248 // Ensure we can skip the write barrier |
249 Handle<Object> uninitialized_sentinel = UninitializedSentinel(isolate); | 249 Handle<Object> uninitialized_sentinel = UninitializedSentinel(isolate); |
250 DCHECK_EQ(*factory->uninitialized_symbol(), *uninitialized_sentinel); | 250 DCHECK_EQ(isolate->heap()->uninitialized_symbol(), *uninitialized_sentinel); |
251 for (int i = 0; i < slot_count;) { | 251 for (int i = 0; i < slot_count;) { |
252 FeedbackVectorSlot slot(i); | 252 FeedbackVectorSlot slot(i); |
253 FeedbackVectorSlotKind kind = metadata->GetKind(slot); | 253 FeedbackVectorSlotKind kind = metadata->GetKind(slot); |
254 int index = TypeFeedbackVector::GetIndex(slot); | 254 int index = TypeFeedbackVector::GetIndex(slot); |
255 int entry_size = TypeFeedbackMetadata::GetSlotSize(kind); | 255 int entry_size = TypeFeedbackMetadata::GetSlotSize(kind); |
256 | 256 |
257 Object* value; | 257 Object* value; |
258 if (kind == FeedbackVectorSlotKind::LOAD_GLOBAL_IC) { | 258 if (kind == FeedbackVectorSlotKind::LOAD_GLOBAL_IC) { |
259 value = *factory->empty_weak_cell(); | 259 value = isolate->heap()->empty_weak_cell(); |
260 } else if (kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC || | 260 } else if (kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC || |
261 kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC) { | 261 kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC) { |
262 value = Smi::kZero; | 262 value = Smi::kZero; |
263 } else { | 263 } else { |
264 value = *uninitialized_sentinel; | 264 value = *uninitialized_sentinel; |
265 } | 265 } |
266 array->set(index, value, SKIP_WRITE_BARRIER); | 266 array->set(index, value, SKIP_WRITE_BARRIER); |
267 | 267 |
268 value = kind == FeedbackVectorSlotKind::CALL_IC ? Smi::kZero | 268 value = kind == FeedbackVectorSlotKind::CALL_IC ? Smi::kZero |
269 : *uninitialized_sentinel; | 269 : *uninitialized_sentinel; |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 return BinaryOperationHintFromFeedback(feedback); | 1071 return BinaryOperationHintFromFeedback(feedback); |
1072 } | 1072 } |
1073 | 1073 |
1074 CompareOperationHint CompareICNexus::GetCompareOperationFeedback() const { | 1074 CompareOperationHint CompareICNexus::GetCompareOperationFeedback() const { |
1075 int feedback = Smi::cast(GetFeedback())->value(); | 1075 int feedback = Smi::cast(GetFeedback())->value(); |
1076 return CompareOperationHintFromFeedback(feedback); | 1076 return CompareOperationHintFromFeedback(feedback); |
1077 } | 1077 } |
1078 | 1078 |
1079 } // namespace internal | 1079 } // namespace internal |
1080 } // namespace v8 | 1080 } // namespace v8 |
OLD | NEW |