diff options
Diffstat (limited to 'Source/JavaScriptCore/bytecode/OperandsInlines.h')
-rw-r--r-- | Source/JavaScriptCore/bytecode/OperandsInlines.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/Source/JavaScriptCore/bytecode/OperandsInlines.h b/Source/JavaScriptCore/bytecode/OperandsInlines.h index 74ad60bc1..65fedda07 100644 --- a/Source/JavaScriptCore/bytecode/OperandsInlines.h +++ b/Source/JavaScriptCore/bytecode/OperandsInlines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2013, 2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,31 +23,43 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OperandsInlines_h -#define OperandsInlines_h +#pragma once #include "Operands.h" #include <wtf/CommaPrinter.h> namespace JSC { -template<typename T, typename Traits> -void Operands<T, Traits>::dumpInContext(PrintStream& out, DumpContext* context) const +template<typename T> +void Operands<T>::dumpInContext(PrintStream& out, DumpContext* context) const { CommaPrinter comma(" "); for (size_t argumentIndex = numberOfArguments(); argumentIndex--;) { - if (Traits::isEmptyForDump(argument(argumentIndex))) + if (!argument(argumentIndex)) continue; out.print(comma, "arg", argumentIndex, ":", inContext(argument(argumentIndex), context)); } for (size_t localIndex = 0; localIndex < numberOfLocals(); ++localIndex) { - if (Traits::isEmptyForDump(local(localIndex))) + if (!local(localIndex)) continue; out.print(comma, "loc", localIndex, ":", inContext(local(localIndex), context)); } } -} // namespace JSC - -#endif // OperandsInlines_h +template<typename T> +void Operands<T>::dump(PrintStream& out) const +{ + CommaPrinter comma(" "); + for (size_t argumentIndex = numberOfArguments(); argumentIndex--;) { + if (!argument(argumentIndex)) + continue; + out.print(comma, "arg", argumentIndex, ":", argument(argumentIndex)); + } + for (size_t localIndex = 0; localIndex < numberOfLocals(); ++localIndex) { + if (!local(localIndex)) + continue; + out.print(comma, "loc", localIndex, ":", local(localIndex)); + } +} +} // namespace JSC |