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/feedback-vector.h" | 5 #include "src/feedback-vector.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/feedback-vector-inl.h" | 7 #include "src/feedback-vector-inl.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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 array->set(index, Smi::kZero, SKIP_WRITE_BARRIER); | 243 array->set(index, Smi::kZero, SKIP_WRITE_BARRIER); |
244 break; | 244 break; |
245 } | 245 } |
246 for (int j = 1; j < entry_size; j++) { | 246 for (int j = 1; j < entry_size; j++) { |
247 array->set(index + j, extra_value, SKIP_WRITE_BARRIER); | 247 array->set(index + j, extra_value, SKIP_WRITE_BARRIER); |
248 } | 248 } |
249 i += entry_size; | 249 i += entry_size; |
250 } | 250 } |
251 | 251 |
252 Handle<FeedbackVector> result = Handle<FeedbackVector>::cast(array); | 252 Handle<FeedbackVector> result = Handle<FeedbackVector>::cast(array); |
253 if (isolate->IsCodeCoverageEnabled()) AddToCodeCoverageList(isolate, result); | 253 if (!isolate->is_best_effort_code_coverage()) { |
| 254 AddToCodeCoverageList(isolate, result); |
| 255 } |
254 return result; | 256 return result; |
255 } | 257 } |
256 | 258 |
257 // static | 259 // static |
258 Handle<FeedbackVector> FeedbackVector::Copy(Isolate* isolate, | 260 Handle<FeedbackVector> FeedbackVector::Copy(Isolate* isolate, |
259 Handle<FeedbackVector> vector) { | 261 Handle<FeedbackVector> vector) { |
260 Handle<FeedbackVector> result; | 262 Handle<FeedbackVector> result; |
261 result = Handle<FeedbackVector>::cast( | 263 result = Handle<FeedbackVector>::cast( |
262 isolate->factory()->CopyFixedArray(Handle<FixedArray>::cast(vector))); | 264 isolate->factory()->CopyFixedArray(Handle<FixedArray>::cast(vector))); |
263 if (isolate->IsCodeCoverageEnabled()) AddToCodeCoverageList(isolate, result); | 265 if (!isolate->is_best_effort_code_coverage()) { |
| 266 AddToCodeCoverageList(isolate, result); |
| 267 } |
264 return result; | 268 return result; |
265 } | 269 } |
266 | 270 |
267 // static | 271 // static |
268 void FeedbackVector::AddToCodeCoverageList(Isolate* isolate, | 272 void FeedbackVector::AddToCodeCoverageList(Isolate* isolate, |
269 Handle<FeedbackVector> vector) { | 273 Handle<FeedbackVector> vector) { |
270 DCHECK(isolate->IsCodeCoverageEnabled()); | 274 DCHECK(!isolate->is_best_effort_code_coverage()); |
271 if (!vector->shared_function_info()->IsSubjectToDebugging()) return; | 275 if (!vector->shared_function_info()->IsSubjectToDebugging()) return; |
272 Handle<ArrayList> list = | 276 Handle<ArrayList> list = |
273 Handle<ArrayList>::cast(isolate->factory()->code_coverage_list()); | 277 Handle<ArrayList>::cast(isolate->factory()->code_coverage_list()); |
274 list = ArrayList::Add(list, vector); | 278 list = ArrayList::Add(list, vector); |
275 isolate->SetCodeCoverageList(*list); | 279 isolate->SetCodeCoverageList(*list); |
276 } | 280 } |
277 | 281 |
278 void FeedbackVector::ClearSlots(JSFunction* host_function) { | 282 void FeedbackVector::ClearSlots(JSFunction* host_function) { |
279 Isolate* isolate = GetIsolate(); | 283 Isolate* isolate = GetIsolate(); |
280 | 284 |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 Handle<Tuple2> entry = Handle<Tuple2>::cast(maybe_entry); | 1091 Handle<Tuple2> entry = Handle<Tuple2>::cast(maybe_entry); |
1088 Handle<String> type = | 1092 Handle<String> type = |
1089 Handle<String>(String::cast(entry->value1()), isolate); | 1093 Handle<String>(String::cast(entry->value1()), isolate); |
1090 int position = Smi::cast(entry->value2())->value(); | 1094 int position = Smi::cast(entry->value2())->value(); |
1091 PrintF("%d: %s\n", position, type->ToCString().get()); | 1095 PrintF("%d: %s\n", position, type->ToCString().get()); |
1092 } | 1096 } |
1093 } | 1097 } |
1094 | 1098 |
1095 } // namespace internal | 1099 } // namespace internal |
1096 } // namespace v8 | 1100 } // namespace v8 |
OLD | NEW |