| 1 | /* |
| 2 | * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
| 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #ifndef CachedCall_h |
| 27 | #define CachedCall_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/interpreter/CachedCall.h:27:9`! |
| 28 | |
| 29 | #include "CallFrameClosure.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/CallFrameClosure.h`/ |
| 30 | #include "JSFunction.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSFunction.h`/ |
| 31 | #include "JSGlobalObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h`/ |
| 32 | #include "Interpreter.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.h`/ |
| 33 | |
| 34 | namespace JSCcxx . . $ QTJSC/ { |
| 35 | class CachedCallcxx . . $ QTJSC/CachedCall# : public Noncopyablecxx . . $ Noncopyable# { |
| 36 | public: |
| 37 | CachedCallcxx . . $ QTJSC/CachedCall#CachedCall(f8d1ab3b8a580a38).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame, JSFunctioncxx . . $ QTJSC/JSFunction#* function, int argCount, JSValuecxx . . $ QTJSC/JSValue#* exception) |
| 38 | : m_validcxx . . $ QTJSC/CachedCall#m_valid.(false) |
| 39 | , m_interpretercxx . . $ QTJSC/CachedCall#m_interpreter.(callFrame->interpretercxx . . $ QTJSC/ExecState#interpreter(6574b75232d5177f).()) |
| 40 | , m_exceptioncxx . . $ QTJSC/CachedCall#m_exception.(exception) |
| 41 | , m_globalObjectScopecxx . . $ QTJSC/CachedCall#m_globalObjectScope.(callFrame, function->scopecxx . . $ QTJSC/JSFunction#scope(b239d380c31bc982).().globalObjectcxx . . $ QTJSC/ScopeChain#globalObject(3d50c730b5e26899).()) |
| 42 | { |
| 43 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!function->isHostFunction()); |
| 44 | m_closurecxx . . $ QTJSC/CachedCall#m_closure. =cxx . . $ QTJSC/CallFrameClosure#`operator=`(ee25ea7f4d026bad). m_interpretercxx . . $ QTJSC/CachedCall#m_interpreter.->prepareForRepeatCallcxx . . $ QTJSC/Interpreter#prepareForRepeatCall(4e6bc6f4477ad73c).(function->jsExecutablecxx . . $ QTJSC/JSFunction#jsExecutable(41a6d61c9ef790ed).(), callFrame, function, argCount, function->scopecxx . . $ QTJSC/JSFunction#scope(b239d380c31bc982).().nodecxx . . $ QTJSC/ScopeChain#node(7483ce9f56294eec).(), exception); |
| 45 | m_validcxx . . $ QTJSC/CachedCall#m_valid. = !*exception; |
| 46 | } |
| 47 | |
| 48 | JSValuecxx . . $ QTJSC/JSValue# callcxx . . $ QTJSC/CachedCall#call(ad9afe69d7bf6378).() |
| 49 | { |
| 50 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_valid); |
| 51 | return m_interpretercxx . . $ QTJSC/CachedCall#m_interpreter.->executecxx . . $ QTJSC/Interpreter#execute(c7284d9f486c89c0).(m_closurecxx . . $ QTJSC/CachedCall#m_closure., m_exceptioncxx . . $ QTJSC/CachedCall#m_exception.); |
| 52 | } |
| 53 | void setThiscxx . . $ QTJSC/CachedCall#setThis(5c2ac18db087b3e6).(JSValuecxx . . $ QTJSC/JSValue# v) { m_closurecxx . . $ QTJSC/CachedCall#m_closure..setArgumentcxx . . $ QTJSC/CallFrameClosure#setArgument(29f01bda67f3f85b).(0, v); } |
| 54 | void setArgumentcxx . . $ QTJSC/CachedCall#setArgument(29f01bda67f3f85b).(int n, JSValuecxx . . $ QTJSC/JSValue# v) { m_closurecxx . . $ QTJSC/CachedCall#m_closure..setArgumentcxx . . $ QTJSC/CallFrameClosure#setArgument(29f01bda67f3f85b).(n + 1, v); } |
| 55 | |
| 56 | CallFramecxx . . $ QTJSC/CallFrame#* newCallFramecxx . . $ QTJSC/CachedCall#newCallFrame(c11b4f618a648a01).(ExecStatecxx . . $ QTJSC/ExecState#* exec) |
| 57 | { |
| 58 | CallFramecxx . . $ QTJSC/CallFrame#* callFrame = m_closurecxx . . $ QTJSC/CachedCall#m_closure..newCallFramecxx . . $ QTJSC/CallFrameClosure#newCallFrame.; |
| 59 | callFrame->setScopeChaincxx . . $ QTJSC/ExecState#setScopeChain(fdc7869371484d42).(exec->scopeChaincxx . . $ QTJSC/ExecState#scopeChain(7483ce9f56294eec).()); |
| 60 | return callFrame; |
| 61 | } |
| 62 | |
| 63 | ~cxx . . $ QTJSC/CachedCall#`~CachedCall`(49f6e7a06ebc5aa8).CachedCallcxx . . $ QTJSC/CachedCall#() |
| 64 | { |
| 65 | if (m_validcxx . . $ QTJSC/CachedCall#m_valid.) |
| 66 | m_interpretercxx . . $ QTJSC/CachedCall#m_interpreter.->endRepeatCallcxx . . $ QTJSC/Interpreter#endRepeatCall(e91d858123f36bc2).(m_closurecxx . . $ QTJSC/CachedCall#m_closure.); |
| 67 | } |
| 68 | |
| 69 | private: |
| 70 | bool m_validcxx . . $ QTJSC/CachedCall#m_valid.; |
| 71 | Interpretercxx . . $ QTJSC/Interpreter#* m_interpretercxx . . $ QTJSC/CachedCall#m_interpreter.; |
| 72 | JSValuecxx . . $ QTJSC/JSValue#* m_exceptioncxx . . $ QTJSC/CachedCall#m_exception.; |
| 73 | DynamicGlobalObjectScopecxx . . $ QTJSC/DynamicGlobalObjectScope# m_globalObjectScopecxx . . $ QTJSC/CachedCall#m_globalObjectScope.; |
| 74 | CallFrameClosurecxx . . $ QTJSC/CallFrameClosure# m_closurecxx . . $ QTJSC/CachedCall#m_closure.; |
| 75 | }; |
| 76 | } |
| 77 | |
| 78 | #endif |