Index: src/top.h |
=================================================================== |
--- src/top.h (revision 539) |
+++ src/top.h (working copy) |
@@ -42,7 +42,6 @@ |
class ThreadLocalTop BASE_EMBEDDED { |
public: |
- Context* security_context_; |
// The context where the current execution method is created and for variable |
// lookups. |
Context* context_; |
@@ -70,12 +69,11 @@ |
}; |
#define TOP_ADDRESS_LIST(C) \ |
- C(handler_address) \ |
+ C(handler_address) \ |
C(c_entry_fp_address) \ |
C(context_address) \ |
C(pending_exception_address) \ |
- C(external_caught_exception_address) \ |
- C(security_context_address) |
+ C(external_caught_exception_address) |
class Top { |
public: |
@@ -88,18 +86,6 @@ |
static Address get_address_from_id(AddressId id); |
- // Access to the security context from which JS execution started. |
- // In a browser world, it is the JS context of the frame which initiated |
- // JavaScript execution. |
- static Context* security_context() { return thread_local_.security_context_; } |
- static void set_security_context(Context* context) { |
- ASSERT(context == NULL || context->IsGlobalContext()); |
- thread_local_.security_context_ = context; |
- } |
- static Context** security_context_address() { |
- return &thread_local_.security_context_; |
- } |
- |
// Access to top context (where the current function object was created). |
static Context* context() { return thread_local_.context_; } |
static void set_context(Context* context) { |
@@ -243,18 +229,22 @@ |
static void Iterate(ObjectVisitor* v, ThreadLocalTop* t); |
static char* Iterate(ObjectVisitor* v, char* t); |
- static Handle<JSObject> global() { |
- return Handle<JSObject>(context()->global()); |
+ // Returns the global object of the current context. It could be |
+ // a builtin object, or a js global object. |
+ static Handle<GlobalObject> global() { |
+ return Handle<GlobalObject>(context()->global()); |
} |
+ |
+ // Returns the global proxy object of the current context. |
+ static Object* global_proxy() { |
+ return context()->global_proxy(); |
+ } |
+ |
static Handle<Context> global_context(); |
static Handle<JSBuiltinsObject> builtins() { |
return Handle<JSBuiltinsObject>(thread_local_.context_->builtins()); |
} |
- static Handle<JSBuiltinsObject> security_context_builtins() { |
- return Handle<JSBuiltinsObject>( |
- thread_local_.security_context_->builtins()); |
- } |
static Object* LookupSpecialFunction(JSObject* receiver, |
JSObject* prototype, |
@@ -308,24 +298,20 @@ |
public: |
SaveContext() : |
context_(Top::context()), |
- security_context_(Top::security_context()), |
prev_(Top::save_context()) { |
Top::set_save_context(this); |
} |
~SaveContext() { |
Top::set_context(*context_); |
- Top::set_security_context(*security_context_); |
Top::set_save_context(prev_); |
} |
Handle<Context> context() { return context_; } |
- Handle<Context> security_context() { return security_context_; } |
SaveContext* prev() { return prev_; } |
private: |
Handle<Context> context_; |
- Handle<Context> security_context_; |
SaveContext* prev_; |
}; |
@@ -334,19 +320,16 @@ |
#ifdef DEBUG |
public: |
AssertNoContextChange() : |
- context_(Top::context()), |
- security_context_(Top::security_context()) { |
+ context_(Top::context()) { |
} |
~AssertNoContextChange() { |
ASSERT(Top::context() == *context_); |
- ASSERT(Top::security_context() == *security_context_); |
} |
private: |
HandleScope scope_; |
Handle<Context> context_; |
- Handle<Context> security_context_; |
#else |
public: |
AssertNoContextChange() { } |