diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h')
-rw-r--r-- | Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h b/Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h index c6fe6c5f0..98e39db1d 100644 --- a/Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h +++ b/Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 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,10 +23,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MethodOfGettingAValueProfile_h -#define MethodOfGettingAValueProfile_h - -#include <wtf/Platform.h> +#pragma once // This is guarded by ENABLE_DFG_JIT only because it uses some value profiles // that are currently only used if the DFG is enabled (i.e. they are not @@ -34,12 +31,15 @@ // these #if's will disappear... #if ENABLE(DFG_JIT) +#include "GPRInfo.h" #include "JSCJSValue.h" namespace JSC { +class CCallHelpers; class CodeBlock; class LazyOperandValueProfileKey; +struct ArithProfile; struct ValueProfile; class MethodOfGettingAValueProfile { @@ -49,7 +49,7 @@ public: { } - explicit MethodOfGettingAValueProfile(ValueProfile* profile) + MethodOfGettingAValueProfile(ValueProfile* profile) { if (profile) { m_kind = Ready; @@ -58,31 +58,34 @@ public: m_kind = None; } + MethodOfGettingAValueProfile(ArithProfile* profile) + { + if (profile) { + m_kind = ArithProfileReady; + u.arithProfile = profile; + } else + m_kind = None; + } + static MethodOfGettingAValueProfile fromLazyOperand( CodeBlock*, const LazyOperandValueProfileKey&); - bool operator!() const { return m_kind == None; } - - // This logically has a pointer to a "There exists X such that - // ValueProfileBase<X>". But since C++ does not have existential - // templates, I cannot return it. So instead, for any methods that - // users of this class would like to call, we'll just have to provide - // a method here that does it through an indirection. Or we could - // possibly just make ValueProfile less template-based. But last I - // tried that, it felt more yucky than this class. + explicit operator bool() const { return m_kind != None; } - EncodedJSValue* getSpecFailBucket(unsigned index) const; + void emitReportValue(CCallHelpers&, JSValueRegs) const; private: enum Kind { None, Ready, + ArithProfileReady, LazyOperand }; Kind m_kind; union { ValueProfile* profile; + ArithProfile* arithProfile; struct { CodeBlock* codeBlock; unsigned bytecodeOffset; @@ -94,6 +97,3 @@ private: } // namespace JSC #endif // ENABLE(DFG_JIT) - -#endif // MethodOfGettingAValueProfile_h - |