| 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/assembler-inl.h" | 10 #include "src/assembler-inl.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return isolate->heap()->undefined_value(); | 164 return isolate->heap()->undefined_value(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 167 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 168 if (function->has_feedback_vector()) { | 168 if (function->has_feedback_vector()) { |
| 169 FeedbackVector* vector = function->feedback_vector(); | 169 FeedbackVector* vector = function->feedback_vector(); |
| 170 | 170 |
| 171 Object* function_name = vector->shared_function_info()->name(); | 171 Object* function_name = vector->shared_function_info()->name(); |
| 172 PrintF("Function: %s\n", String::cast(function_name)->ToCString().get()); | 172 PrintF("Function: %s\n", String::cast(function_name)->ToCString().get()); |
| 173 | 173 |
| 174 FeedbackMetadataIterator iter(vector->metadata()); | 174 FeedbackSlot slot = vector->GetTypeProfileSlot(); |
| 175 while (iter.HasNext()) { | 175 if (!slot.IsInvalid()) { |
| 176 FeedbackSlot slot = iter.Next(); | 176 CollectTypeProfileNexus nexus(vector, slot); |
| 177 FeedbackSlotKind kind = iter.kind(); | 177 nexus.Print(); |
| 178 if (kind == FeedbackSlotKind::kTypeProfile) { | 178 PrintF("\n"); |
| 179 CollectTypeProfileNexus nexus(vector, slot); | |
| 180 nexus.Print(); | |
| 181 PrintF("\n"); | |
| 182 return isolate->heap()->undefined_value(); | |
| 183 } | |
| 184 } | 179 } |
| 185 } | 180 } |
| 186 return isolate->heap()->undefined_value(); | 181 return isolate->heap()->undefined_value(); |
| 187 } | 182 } |
| 188 | 183 |
| 189 RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { | 184 RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { |
| 190 HandleScope scope(isolate); | 185 HandleScope scope(isolate); |
| 191 | 186 |
| 192 // This function is used by fuzzers, ignore calls with bogus arguments count. | 187 // This function is used by fuzzers, ignore calls with bogus arguments count. |
| 193 if (args.length() != 1 && args.length() != 2) { | 188 if (args.length() != 1 && args.length() != 2) { |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 isolate->IncrementWaitCountForTesting(); | 976 isolate->IncrementWaitCountForTesting(); |
| 982 return isolate->heap()->undefined_value(); | 977 return isolate->heap()->undefined_value(); |
| 983 } | 978 } |
| 984 | 979 |
| 985 RUNTIME_FUNCTION(Runtime_DecrementWaitCount) { | 980 RUNTIME_FUNCTION(Runtime_DecrementWaitCount) { |
| 986 isolate->DecrementWaitCountForTesting(); | 981 isolate->DecrementWaitCountForTesting(); |
| 987 return isolate->heap()->undefined_value(); | 982 return isolate->heap()->undefined_value(); |
| 988 } | 983 } |
| 989 } // namespace internal | 984 } // namespace internal |
| 990 } // namespace v8 | 985 } // namespace v8 |
| OLD | NEW |