WebCore/generated/JSScriptProfile.cpp
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     1 /*
       
     2     This file is part of the WebKit open source project.
       
     3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
       
     4 
       
     5     This library is free software; you can redistribute it and/or
       
     6     modify it under the terms of the GNU Library General Public
       
     7     License as published by the Free Software Foundation; either
       
     8     version 2 of the License, or (at your option) any later version.
       
     9 
       
    10     This library is distributed in the hope that it will be useful,
       
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13     Library General Public License for more details.
       
    14 
       
    15     You should have received a copy of the GNU Library General Public License
       
    16     along with this library; see the file COPYING.LIB.  If not, write to
       
    17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
       
    18     Boston, MA 02110-1301, USA.
       
    19 */
       
    20 
       
    21 #include "config.h"
       
    22 
       
    23 #if ENABLE(JAVASCRIPT_DEBUGGER)
       
    24 
       
    25 #include "JSScriptProfile.h"
       
    26 
       
    27 #include "JSScriptProfileNode.h"
       
    28 #include "KURL.h"
       
    29 #include "ScriptProfile.h"
       
    30 #include "ScriptProfileNode.h"
       
    31 #include <runtime/JSNumberCell.h>
       
    32 #include <runtime/JSString.h>
       
    33 #include <wtf/GetPtr.h>
       
    34 
       
    35 using namespace JSC;
       
    36 
       
    37 namespace WebCore {
       
    38 
       
    39 ASSERT_CLASS_FITS_IN_CELL(JSScriptProfile);
       
    40 
       
    41 /* Hash table */
       
    42 #if ENABLE(JIT)
       
    43 #define THUNK_GENERATOR(generator) , generator
       
    44 #else
       
    45 #define THUNK_GENERATOR(generator)
       
    46 #endif
       
    47 
       
    48 static const HashTableValue JSScriptProfileTableValues[4] =
       
    49 {
       
    50     { "title", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScriptProfileTitle), (intptr_t)0 THUNK_GENERATOR(0) },
       
    51     { "uid", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScriptProfileUid), (intptr_t)0 THUNK_GENERATOR(0) },
       
    52     { "head", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScriptProfileHead), (intptr_t)0 THUNK_GENERATOR(0) },
       
    53     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    54 };
       
    55 
       
    56 #undef THUNK_GENERATOR
       
    57 static JSC_CONST_HASHTABLE HashTable JSScriptProfileTable = { 8, 7, JSScriptProfileTableValues, 0 };
       
    58 /* Hash table for prototype */
       
    59 #if ENABLE(JIT)
       
    60 #define THUNK_GENERATOR(generator) , generator
       
    61 #else
       
    62 #define THUNK_GENERATOR(generator)
       
    63 #endif
       
    64 
       
    65 static const HashTableValue JSScriptProfilePrototypeTableValues[1] =
       
    66 {
       
    67     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    68 };
       
    69 
       
    70 #undef THUNK_GENERATOR
       
    71 static JSC_CONST_HASHTABLE HashTable JSScriptProfilePrototypeTable = { 1, 0, JSScriptProfilePrototypeTableValues, 0 };
       
    72 const ClassInfo JSScriptProfilePrototype::s_info = { "ScriptProfilePrototype", 0, &JSScriptProfilePrototypeTable, 0 };
       
    73 
       
    74 JSObject* JSScriptProfilePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
    75 {
       
    76     return getDOMPrototype<JSScriptProfile>(exec, globalObject);
       
    77 }
       
    78 
       
    79 const ClassInfo JSScriptProfile::s_info = { "ScriptProfile", 0, &JSScriptProfileTable, 0 };
       
    80 
       
    81 JSScriptProfile::JSScriptProfile(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<ScriptProfile> impl)
       
    82     : DOMObjectWithGlobalPointer(structure, globalObject)
       
    83     , m_impl(impl)
       
    84 {
       
    85 }
       
    86 
       
    87 JSScriptProfile::~JSScriptProfile()
       
    88 {
       
    89     forgetDOMObject(this, impl());
       
    90 }
       
    91 
       
    92 JSObject* JSScriptProfile::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
    93 {
       
    94     return new (exec) JSScriptProfilePrototype(globalObject, JSScriptProfilePrototype::createStructure(globalObject->objectPrototype()));
       
    95 }
       
    96 
       
    97 bool JSScriptProfile::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    98 {
       
    99     return getStaticValueSlot<JSScriptProfile, Base>(exec, &JSScriptProfileTable, this, propertyName, slot);
       
   100 }
       
   101 
       
   102 bool JSScriptProfile::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   103 {
       
   104     return getStaticValueDescriptor<JSScriptProfile, Base>(exec, &JSScriptProfileTable, this, propertyName, descriptor);
       
   105 }
       
   106 
       
   107 JSValue jsScriptProfileTitle(ExecState* exec, JSValue slotBase, const Identifier&)
       
   108 {
       
   109     JSScriptProfile* castedThis = static_cast<JSScriptProfile*>(asObject(slotBase));
       
   110     UNUSED_PARAM(exec);
       
   111     ScriptProfile* imp = static_cast<ScriptProfile*>(castedThis->impl());
       
   112     JSValue result = jsString(exec, imp->title());
       
   113     return result;
       
   114 }
       
   115 
       
   116 JSValue jsScriptProfileUid(ExecState* exec, JSValue slotBase, const Identifier&)
       
   117 {
       
   118     JSScriptProfile* castedThis = static_cast<JSScriptProfile*>(asObject(slotBase));
       
   119     UNUSED_PARAM(exec);
       
   120     ScriptProfile* imp = static_cast<ScriptProfile*>(castedThis->impl());
       
   121     JSValue result = jsNumber(exec, imp->uid());
       
   122     return result;
       
   123 }
       
   124 
       
   125 JSValue jsScriptProfileHead(ExecState* exec, JSValue slotBase, const Identifier&)
       
   126 {
       
   127     JSScriptProfile* castedThis = static_cast<JSScriptProfile*>(asObject(slotBase));
       
   128     UNUSED_PARAM(exec);
       
   129     ScriptProfile* imp = static_cast<ScriptProfile*>(castedThis->impl());
       
   130     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->head()));
       
   131     return result;
       
   132 }
       
   133 
       
   134 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, ScriptProfile* object)
       
   135 {
       
   136     return getDOMObjectWrapper<JSScriptProfile>(exec, globalObject, object);
       
   137 }
       
   138 ScriptProfile* toScriptProfile(JSC::JSValue value)
       
   139 {
       
   140     return value.inherits(&JSScriptProfile::s_info) ? static_cast<JSScriptProfile*>(asObject(value))->impl() : 0;
       
   141 }
       
   142 
       
   143 }
       
   144 
       
   145 #endif // ENABLE(JAVASCRIPT_DEBUGGER)