1// Copyright 2020 the V8 project authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#include "src/objects/code-kind.h" 6 7namespace v8 { 8namespace internal { 9 10const char* CodeKindToString(CodeKind kind) { 11 switch (kind) { 12#define CASE(name) \ 13 case CodeKind::name: \ 14 return #name; 15 CODE_KIND_LIST(CASE) 16#undef CASE 17 } 18 UNREACHABLE(); 19} 20 21const char* CodeKindToMarker(CodeKind kind) { 22 switch (kind) { 23 case CodeKind::INTERPRETED_FUNCTION: 24 return "~"; 25 case CodeKind::BASELINE: 26 return "^"; 27 case CodeKind::MAGLEV: 28 return "+"; 29 case CodeKind::TURBOFAN: 30 return "*"; 31 default: 32 return ""; 33 } 34} 35 36} // namespace internal 37} // namespace v8 38