source: webkit/trunk/JavaScriptCore/kjs/DebuggerCallFrame.h@ 35900

Last change on this file since 35900 was 35807, checked in by [email protected], 17 years ago

JavaScriptCore:

2008-08-17 Geoffrey Garen <[email protected]>

Reviewed by Cameron Zwarich.

Made room for a free word in JSCell.


SunSpider says no change.


I changed JSCallbackObjectData, Arguments, JSArray, and RegExpObject to
store auxiliary data in a secondary structure.

I changed InternalFunction to store the function's name in the property
map.


I changed JSGlobalObjectData to use a virtual destructor, so WebCore's
JSDOMWindowBaseData could inherit from it safely. (It's a strange design
for JSDOMWindowBase to allocate an object that JSGlobalObject deletes,
but that's really our only option, given the size constraint.)


I also added a bunch of compile-time ASSERTs, and removed lots of comments
in JSObject.h because they were often out of date, and they got in the
way of reading what was actually going on.


Also renamed JSArray::getLength to JSArray::length, to match our style
guidelines.

WebCore:

2008-08-17 Geoffrey Garen <[email protected]>

Reviewed by Cameron Zwarich.

Made room for a free word in JSCell.


Changed JSDOMWindowBase to store its auxiliary data in a subclass of
JSGlobalData, so the two could share a pointer.


Added a bunch of ASSERTs, to help catch over-sized objects.

WebKit/mac:

2008-08-17 Geoffrey Garen <[email protected]>

Reviewed by Cameron Zwarich.

Made room for a free word in JSCell.


(Updated for JavaScriptCore changes.)

File size: 3.0 KB
Line 
1/*
2 * Copyright (C) 2008 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 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14 * its contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef DebuggerCallFrame_h
30#define DebuggerCallFrame_h
31
32namespace KJS {
33
34 class CodeBlock;
35 class ExecState;
36 class JSGlobalObject;
37 class JSObject;
38 class JSValue;
39 class Machine;
40 class UString;
41 class Register;
42 class ScopeChainNode;
43
44 class DebuggerCallFrame {
45 public:
46 enum Type {
47 ProgramType,
48 FunctionType
49 };
50
51 DebuggerCallFrame(ExecState* exec, JSGlobalObject* dynamicGlobalObject, const CodeBlock* codeBlock, ScopeChainNode* scopeChain, Register* r, JSValue* exception)
52 : m_exec(exec)
53 , m_dynamicGlobalObject(dynamicGlobalObject)
54 , m_codeBlock(codeBlock)
55 , m_scopeChain(scopeChain)
56 , m_registers(r)
57 , m_exception(exception)
58 {
59 }
60
61 JSGlobalObject* dynamicGlobalObject() const { return m_dynamicGlobalObject; }
62 const ScopeChainNode* scopeChain() const { return m_scopeChain; }
63 const UString* functionName() const;
64 DebuggerCallFrame::Type type() const;
65 JSObject* thisObject() const;
66 JSValue* evaluate(const UString&, JSValue*& exception) const;
67 JSValue* exception() const { return m_exception; }
68
69 private:
70 Register* callFrame() const;
71
72 ExecState* m_exec;
73 JSGlobalObject* m_dynamicGlobalObject;
74 const CodeBlock* m_codeBlock;
75 ScopeChainNode* m_scopeChain;
76 Register* m_registers;
77 JSValue* m_exception;
78 };
79
80} // namespace KJS
81
82#endif // DebuggerCallFrame_h
Note: See TracBrowser for help on using the repository browser.