diff options
Diffstat (limited to 'JavaScriptCore/bytecode/CodeBlock.h')
-rw-r--r-- | JavaScriptCore/bytecode/CodeBlock.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/JavaScriptCore/bytecode/CodeBlock.h b/JavaScriptCore/bytecode/CodeBlock.h index eb874cc..d92dc9d 100644 --- a/JavaScriptCore/bytecode/CodeBlock.h +++ b/JavaScriptCore/bytecode/CodeBlock.h @@ -36,7 +36,6 @@ #include "JSGlobalObject.h" #include "JumpTable.h" #include "Nodes.h" -#include "PtrAndFlags.h" #include "RegExp.h" #include "UString.h" #include <wtf/FastAllocBase.h> @@ -110,44 +109,54 @@ namespace JSC { CodeLocationNearCall callReturnLocation; CodeLocationDataLabelPtr hotPathBegin; CodeLocationNearCall hotPathOther; - PtrAndFlags<CodeBlock, HasSeenShouldRepatch> ownerCodeBlock; + CodeBlock* ownerCodeBlock; CodeBlock* callee; - unsigned position; + unsigned position : 31; + unsigned hasSeenShouldRepatch : 1; void setUnlinked() { callee = 0; } bool isLinked() { return callee; } bool seenOnce() { - return ownerCodeBlock.isFlagSet(hasSeenShouldRepatch); + return hasSeenShouldRepatch; } void setSeen() { - ownerCodeBlock.setFlag(hasSeenShouldRepatch); + hasSeenShouldRepatch = true; } }; struct MethodCallLinkInfo { MethodCallLinkInfo() : cachedStructure(0) + , cachedPrototypeStructure(0) { } bool seenOnce() { - return cachedPrototypeStructure.isFlagSet(hasSeenShouldRepatch); + ASSERT(!cachedStructure); + return cachedPrototypeStructure; } void setSeen() { - cachedPrototypeStructure.setFlag(hasSeenShouldRepatch); + ASSERT(!cachedStructure && !cachedPrototypeStructure); + // We use the values of cachedStructure & cachedPrototypeStructure to indicate the + // current state. + // - In the initial state, both are null. + // - Once this transition has been taken once, cachedStructure is + // null and cachedPrototypeStructure is set to a nun-null value. + // - Once the call is linked both structures are set to non-null values. + cachedPrototypeStructure = (Structure*)1; } CodeLocationCall callReturnLocation; CodeLocationDataLabelPtr structureLabel; Structure* cachedStructure; - PtrAndFlags<Structure, HasSeenShouldRepatch> cachedPrototypeStructure; + Structure* cachedPrototypeStructure; }; struct FunctionRegisterInfo { |