summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp')
-rw-r--r--Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp30
1 files changed, 21 insertions, 9 deletions
diff --git a/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp b/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
index 838153bea..09b8213d9 100644
--- a/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2014, 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
@@ -27,9 +27,10 @@
#include "ProfilerBytecodeSequence.h"
#include "CodeBlock.h"
+#include "Interpreter.h"
+#include "JSCInlines.h"
#include "JSGlobalObject.h"
#include "Operands.h"
-#include "Operations.h"
#include <wtf/StringPrintStream.h>
namespace JSC { namespace Profiler {
@@ -39,18 +40,21 @@ BytecodeSequence::BytecodeSequence(CodeBlock* codeBlock)
StringPrintStream out;
for (unsigned i = 0; i < codeBlock->numberOfArgumentValueProfiles(); ++i) {
- ConcurrentJITLocker locker(codeBlock->m_lock);
+ ConcurrentJSLocker locker(codeBlock->m_lock);
CString description = codeBlock->valueProfileForArgument(i)->briefDescription(locker);
if (!description.length())
continue;
out.reset();
- out.print("arg", i, " (r", virtualRegisterForArgument(i).offset(), "): ", description);
+ out.print("arg", i, ": ", description);
m_header.append(out.toCString());
}
+ StubInfoMap stubInfos;
+ codeBlock->getStubInfoMap(stubInfos);
+
for (unsigned bytecodeIndex = 0; bytecodeIndex < codeBlock->instructions().size();) {
out.reset();
- codeBlock->dumpBytecode(out, bytecodeIndex);
+ codeBlock->dumpBytecode(out, bytecodeIndex, stubInfos);
m_sequence.append(Bytecode(bytecodeIndex, codeBlock->vm()->interpreter->getOpcodeID(codeBlock->instructions()[bytecodeIndex].u.opcode), out.toCString()));
bytecodeIndex += opcodeLength(
codeBlock->vm()->interpreter->getOpcodeID(
@@ -74,15 +78,23 @@ const Bytecode& BytecodeSequence::forBytecodeIndex(unsigned bytecodeIndex) const
void BytecodeSequence::addSequenceProperties(ExecState* exec, JSObject* result) const
{
+ VM& vm = exec->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
JSArray* header = constructEmptyArray(exec, 0);
- for (unsigned i = 0; i < m_header.size(); ++i)
+ RETURN_IF_EXCEPTION(scope, void());
+ for (unsigned i = 0; i < m_header.size(); ++i) {
header->putDirectIndex(exec, i, jsString(exec, String::fromUTF8(m_header[i])));
- result->putDirect(exec->vm(), exec->propertyNames().header, header);
+ RETURN_IF_EXCEPTION(scope, void());
+ }
+ result->putDirect(vm, exec->propertyNames().header, header);
JSArray* sequence = constructEmptyArray(exec, 0);
- for (unsigned i = 0; i < m_sequence.size(); ++i)
+ RETURN_IF_EXCEPTION(scope, void());
+ for (unsigned i = 0; i < m_sequence.size(); ++i) {
sequence->putDirectIndex(exec, i, m_sequence[i].toJS(exec));
- result->putDirect(exec->vm(), exec->propertyNames().bytecode, sequence);
+ RETURN_IF_EXCEPTION(scope, void());
+ }
+ result->putDirect(vm, exec->propertyNames().bytecode, sequence);
}
} } // namespace JSC::Profiler