source: webkit/trunk/JavaScriptCore/kjs/context.h@ 12512

Last change on this file since 12512 was 12317, checked in by mjs, 19 years ago

Reviewed by Tim Hatcher.


  • it's "Franklin Street", not "Franklin Steet"
  • kjs/array_instance.h:
  • kjs/array_object.cpp:
  • kjs/array_object.h:
  • kjs/bool_object.cpp:
  • kjs/bool_object.h:
  • kjs/collector.cpp:
  • kjs/collector.h:
  • kjs/completion.h:
  • kjs/context.h:
  • kjs/date_object.cpp:
  • kjs/date_object.h:
  • kjs/debugger.cpp:
  • kjs/debugger.h:
  • kjs/dtoa.h:
  • kjs/error_object.cpp:
  • kjs/error_object.h:
  • kjs/function.cpp:
  • kjs/function.h:
  • kjs/function_object.cpp:
  • kjs/function_object.h:
  • kjs/grammar.y:
  • kjs/identifier.cpp:
  • kjs/identifier.h:
  • kjs/internal.cpp:
  • kjs/internal.h:
  • kjs/interpreter.cpp:
  • kjs/interpreter.h:
  • kjs/lexer.cpp:
  • kjs/lexer.h:
  • kjs/list.cpp:
  • kjs/list.h:
  • kjs/lookup.cpp:
  • kjs/lookup.h:
  • kjs/math_object.cpp:
  • kjs/math_object.h:
  • kjs/nodes.cpp:
  • kjs/nodes.h:
  • kjs/nodes2string.cpp:
  • kjs/number_object.cpp:
  • kjs/number_object.h:
  • kjs/object.cpp:
  • kjs/object.h:
  • kjs/object_object.cpp:
  • kjs/object_object.h:
  • kjs/operations.cpp:
  • kjs/operations.h:
  • kjs/property_map.cpp:
  • kjs/property_map.h:
  • kjs/property_slot.cpp:
  • kjs/property_slot.h:
  • kjs/reference.cpp:
  • kjs/reference.h:
  • kjs/reference_list.cpp:
  • kjs/reference_list.h:
  • kjs/regexp.cpp:
  • kjs/regexp.h:
  • kjs/regexp_object.cpp:
  • kjs/regexp_object.h:
  • kjs/scope_chain.cpp:
  • kjs/scope_chain.h:
  • kjs/simple_number.h:
  • kjs/string_object.cpp:
  • kjs/string_object.h:
  • kjs/testkjs.cpp:
  • kjs/types.h:
  • kjs/ustring.cpp:
  • kjs/ustring.h:
  • kjs/value.cpp:
  • kjs/value.h:
  • kxmlcore/AlwaysInline.h:
  • kxmlcore/ListRefPtr.h:
  • kxmlcore/PassRefPtr.h:
  • kxmlcore/RefPtr.h:
  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2001 Harri Porten ([email protected])
5 * Copyright (C) 2001 Peter Kelly ([email protected])
6 * Copyright (C) 2003 Apple Computer, Inc.
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 *
23 */
24
25#ifndef KJS_CONTEXT_H
26#define KJS_CONTEXT_H
27
28#include "function.h"
29#include "protect.h"
30
31namespace KJS {
32
33 /**
34 * @short Execution context.
35 */
36 class ContextImp {
37 public:
38 ContextImp(JSObject *glob, InterpreterImp *, JSObject *thisV, CodeType type = GlobalCode,
39 ContextImp *callingContext = 0, FunctionImp *functiion = 0, const List *args = 0);
40 ~ContextImp();
41
42 const ScopeChain &scopeChain() const { return scope; }
43 CodeType codeType() { return m_codeType; }
44 JSObject *variableObject() const { return variable; }
45 void setVariableObject(JSObject *v) { variable = v; }
46 JSObject *thisValue() const { return thisVal; }
47 ContextImp *callingContext() { return _callingContext; }
48 JSObject *activationObject() { return activation; }
49 FunctionImp *function() const { return _function; }
50 const List *arguments() const { return _arguments; }
51
52 void pushScope(JSObject *s) { scope.push(s); }
53 void popScope() { scope.pop(); }
54 LabelStack *seenLabels() { return &ls; }
55
56 void mark();
57
58 private:
59 InterpreterImp *_interpreter;
60 ContextImp *_callingContext;
61 FunctionImp *_function;
62 const List *_arguments;
63 // because ContextImp is always allocated on the stack,
64 // there is no need to protect various pointers from conservative
65 // GC since they will be caught by the conservative sweep anyway!
66 JSObject *activation;
67
68 ScopeChain scope;
69 JSObject *variable;
70 JSObject *thisVal;
71
72 LabelStack ls;
73 CodeType m_codeType;
74 };
75
76} // namespace KJS
77
78#endif
Note: See TracBrowser for help on using the repository browser.