Commit 55e62278 authored by rossberg@chromium.org's avatar rossberg@chromium.org

Rename JSGlobalProxy::context to native_context,

for clarity and consistency with GlobalObject::native_context.

R=svenpanne@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10861007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12341 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 95fa9485
......@@ -1372,7 +1372,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
}
// Check if both contexts are the same.
ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset));
ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
cmp(scratch, Operand(ip));
b(eq, &same_contexts);
......@@ -1394,7 +1394,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
// Restore ip is not needed. ip is reloaded below.
pop(holder_reg); // Restore holder.
// Restore ip to holder's context.
ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset));
ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
}
// Check that the security token in the calling global object is
......
......@@ -327,7 +327,8 @@ static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) {
void Bootstrapper::DetachGlobal(Handle<Context> env) {
Factory* factory = env->GetIsolate()->factory();
JSGlobalProxy::cast(env->global_proxy())->set_context(*factory->null_value());
JSGlobalProxy::cast(env->global_proxy())->
set_native_context(*factory->null_value());
SetObjectPrototype(Handle<JSObject>(env->global_proxy()),
factory->null_value());
env->set_global_proxy(env->global_object());
......@@ -342,7 +343,7 @@ void Bootstrapper::ReattachGlobal(Handle<Context> env,
env->global_object()->set_global_receiver(*global);
env->set_global_proxy(*global);
SetObjectPrototype(global, Handle<JSObject>(env->global_object()));
global->set_context(*env);
global->set_native_context(*env);
}
......@@ -797,7 +798,7 @@ void Genesis::HookUpGlobalProxy(Handle<GlobalObject> inner_global,
// Set the native context for the global object.
inner_global->set_native_context(*native_context());
inner_global->set_global_receiver(*global_proxy);
global_proxy->set_context(*native_context());
global_proxy->set_native_context(*native_context());
native_context()->set_global_proxy(*global_proxy);
}
......
......@@ -999,7 +999,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
}
// Check if both contexts are the same.
cmp(scratch, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
cmp(scratch, FieldOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
j(equal, &same_contexts);
// Compare security tokens, save holder_reg on the stack so we can use it
......@@ -1010,7 +1010,8 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
// Check that the security token in the calling global object is
// compatible with the security token in the receiving global
// object.
mov(holder_reg, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
mov(holder_reg,
FieldOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
// Check the context is a native context.
if (emit_debug_code()) {
......
......@@ -789,7 +789,7 @@ static MayAccessDecision MayAccessPreCheck(Isolate* isolate,
if (isolate->bootstrapper()->IsActive()) return YES;
if (receiver->IsJSGlobalProxy()) {
Object* receiver_context = JSGlobalProxy::cast(receiver)->context();
Object* receiver_context = JSGlobalProxy::cast(receiver)->native_context();
if (!receiver_context->IsContext()) return NO;
// Get the native context of current top context.
......
......@@ -238,7 +238,7 @@ class VerifyNativeContextSeparationVisitor: public ObjectVisitor {
CheckContext(JSFunction::cast(object)->context());
break;
case JS_GLOBAL_PROXY_TYPE:
CheckContext(JSGlobalProxy::cast(object)->context());
CheckContext(JSGlobalProxy::cast(object)->native_context());
break;
case JS_GLOBAL_OBJECT_TYPE:
case JS_BUILTINS_OBJECT_TYPE:
......
......@@ -380,7 +380,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
}
// Check if both contexts are the same.
lw(at, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset));
lw(at, FieldMemOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
Branch(&same_contexts, eq, scratch, Operand(at));
// Check the context is a native context.
......@@ -399,7 +399,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
// Restore at is not needed. at is reloaded below.
pop(holder_reg); // Restore holder.
// Restore at to holder's context.
lw(at, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset));
lw(at, FieldMemOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
}
// Check that the security token in the calling global object is
......
......@@ -521,7 +521,7 @@ void SharedFunctionInfo::SharedFunctionInfoVerify() {
void JSGlobalProxy::JSGlobalProxyVerify() {
CHECK(IsJSGlobalProxy());
JSObjectVerify();
VerifyObjectField(JSGlobalProxy::kContextOffset);
VerifyObjectField(JSGlobalProxy::kNativeContextOffset);
// Make sure that this object has no properties, elements.
CHECK_EQ(0, properties()->length());
CHECK(HasFastObjectElements());
......
......@@ -3672,7 +3672,7 @@ ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset)
ACCESSORS(GlobalObject, native_context, Context, kNativeContextOffset)
ACCESSORS(GlobalObject, global_receiver, JSObject, kGlobalReceiverOffset)
ACCESSORS(JSGlobalProxy, context, Object, kContextOffset)
ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset)
ACCESSORS(AccessorInfo, getter, Object, kGetterOffset)
ACCESSORS(AccessorInfo, setter, Object, kSetterOffset)
......
......@@ -824,8 +824,8 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(FILE* out) {
void JSGlobalProxy::JSGlobalProxyPrint(FILE* out) {
PrintF(out, "global_proxy ");
JSObjectPrint(out);
PrintF(out, "context : ");
context()->ShortPrint(out);
PrintF(out, "native context : ");
native_context()->ShortPrint(out);
PrintF(out, "\n");
}
......
......@@ -6162,9 +6162,9 @@ class JSFunction: public JSObject {
class JSGlobalProxy : public JSObject {
public:
// [context]: the owner native context of this global proxy object.
// [native_context]: the owner native context of this global proxy object.
// It is null value if this object is not used by any context.
DECL_ACCESSORS(context, Object)
DECL_ACCESSORS(native_context, Object)
// Casting.
static inline JSGlobalProxy* cast(Object* obj);
......@@ -6181,8 +6181,8 @@ class JSGlobalProxy : public JSObject {
#endif
// Layout description.
static const int kContextOffset = JSObject::kHeaderSize;
static const int kSize = kContextOffset + kPointerSize;
static const int kNativeContextOffset = JSObject::kHeaderSize;
static const int kSize = kNativeContextOffset + kPointerSize;
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy);
......
......@@ -3456,7 +3456,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
}
// Check if both contexts are the same.
cmpq(scratch, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
cmpq(scratch, FieldOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
j(equal, &same_contexts);
// Compare security tokens.
......@@ -3468,7 +3468,8 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
if (emit_debug_code()) {
// Preserve original value of holder_reg.
push(holder_reg);
movq(holder_reg, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
movq(holder_reg,
FieldOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
CompareRoot(holder_reg, Heap::kNullValueRootIndex);
Check(not_equal, "JSGlobalProxy::context() should not be null.");
......@@ -3480,7 +3481,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
}
movq(kScratchRegister,
FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
FieldOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
int token_offset =
Context::kHeaderSize + Context::SECURITY_TOKEN_INDEX * kPointerSize;
movq(scratch, FieldOperand(scratch, token_offset));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment