diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/JavaScriptCore/bytecode/CodeOrigin.h | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/bytecode/CodeOrigin.h')
-rw-r--r-- | Source/JavaScriptCore/bytecode/CodeOrigin.h | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/bytecode/CodeOrigin.h b/Source/JavaScriptCore/bytecode/CodeOrigin.h index d8fbf7328..5d9eaa041 100644 --- a/Source/JavaScriptCore/bytecode/CodeOrigin.h +++ b/Source/JavaScriptCore/bytecode/CodeOrigin.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. + * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,12 +31,14 @@ #include "ValueRecovery.h" #include "WriteBarrier.h" #include <wtf/BitVector.h> +#include <wtf/PrintStream.h> #include <wtf/StdLibExtras.h> #include <wtf/Vector.h> namespace JSC { struct InlineCallFrame; +class ExecState; class ExecutableBase; class JSFunction; @@ -63,8 +65,8 @@ struct CodeOrigin { , valueProfileOffset(valueProfileOffset) , inlineCallFrame(inlineCallFrame) { - ASSERT(bytecodeIndex <= maximumBytecodeIndex); - ASSERT(valueProfileOffset < (1u << 3)); + RELEASE_ASSERT(bytecodeIndex <= maximumBytecodeIndex); + RELEASE_ASSERT(valueProfileOffset < (1u << 3)); } bool isSet() const { return bytecodeIndex != maximumBytecodeIndex; } @@ -82,6 +84,8 @@ struct CodeOrigin { // would have owned the code if it had not been inlined. Otherwise returns 0. ExecutableBase* codeOriginOwner() const; + unsigned stackOffset() const; + static unsigned inlineDepthForCallFrame(InlineCallFrame*); bool operator==(const CodeOrigin& other) const; @@ -90,12 +94,14 @@ struct CodeOrigin { // Get the inline stack. This is slow, and is intended for debugging only. Vector<CodeOrigin> inlineStack() const; + + void dump(PrintStream&) const; }; struct InlineCallFrame { Vector<ValueRecovery> arguments; WriteBarrier<ExecutableBase> executable; - WriteBarrier<JSFunction> callee; + WriteBarrier<JSFunction> callee; // This may be null, indicating that this is a closure call and that the JSFunction and JSScope are already on the stack. CodeOrigin caller; BitVector capturedVars; // Indexed by the machine call frame's variable numbering. unsigned stackOffset : 31; @@ -103,7 +109,20 @@ struct InlineCallFrame { CodeSpecializationKind specializationKind() const { return specializationFromIsCall(isCall); } + bool isClosureCall() const { return !callee; } + + // Get the callee given a machine call frame to which this InlineCallFrame belongs. + JSFunction* calleeForCallFrame(ExecState*) const; + + String inferredName() const; CodeBlockHash hash() const; + + CodeBlock* baselineCodeBlock() const; + + void dumpBriefFunctionInformation(PrintStream&) const; + void dump(PrintStream&) const; + + MAKE_PRINT_METHOD(InlineCallFrame, dumpBriefFunctionInformation, briefFunctionInformation); }; struct CodeOriginAtCallReturnOffset { @@ -111,6 +130,14 @@ struct CodeOriginAtCallReturnOffset { unsigned callReturnOffset; }; +inline unsigned CodeOrigin::stackOffset() const +{ + if (!inlineCallFrame) + return 0; + + return inlineCallFrame->stackOffset; +} + inline bool CodeOrigin::operator==(const CodeOrigin& other) const { return bytecodeIndex == other.bytecodeIndex |