Fix style issues.

TBR=iposva

Review URL: http://codereview.chromium.org/7830

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@543 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
feng@chromium.org 2008-10-21 20:08:49 +00:00
parent 4bb03e97a6
commit 648f6d21c6
9 changed files with 17 additions and 18 deletions

View File

@ -2255,7 +2255,7 @@ Persistent<Context> v8::Context::New(
i::Handle<i::FunctionTemplateInfo> proxy_constructor =
EnsureConstructor(Utils::OpenHandle(*proxy_template));
// Set the global template to be the prototype template
// of global proxy template.
proxy_constructor->set_prototype_template(

View File

@ -543,7 +543,7 @@ void Genesis::CreateRoots(v8::Handle<v8::ObjectTemplate> global_template,
if (!proto_template->IsUndefined()) {
js_global_template =
Handle<ObjectTemplateInfo>::cast(proto_template);
}
}
}
if (js_global_template.is_null()) {
@ -1195,7 +1195,7 @@ bool Genesis::ConfigureGlobalObjects(
Handle<JSObject> js_global(JSObject::cast(global_context()->global()));
if (!global_proxy_template.IsEmpty()) {
// Configure the global proxy object.
// Configure the global proxy object.
Handle<ObjectTemplateInfo> proxy_data =
v8::Utils::OpenHandle(*global_proxy_template);
if (!ConfigureApiObject(global_proxy, proxy_data)) return false;
@ -1204,7 +1204,7 @@ bool Genesis::ConfigureGlobalObjects(
Handle<FunctionTemplateInfo> proxy_constructor(
FunctionTemplateInfo::cast(proxy_data->constructor()));
if (!proxy_constructor->prototype_template()->IsUndefined()) {
Handle<ObjectTemplateInfo> inner_data(
Handle<ObjectTemplateInfo> inner_data(
ObjectTemplateInfo::cast(proxy_constructor->prototype_template()));
if (!ConfigureApiObject(js_global, inner_data)) return false;
}
@ -1214,7 +1214,7 @@ bool Genesis::ConfigureGlobalObjects(
return true;
}
bool Genesis::ConfigureApiObject(Handle<JSObject> object,
Handle<ObjectTemplateInfo> object_template) {
ASSERT(!object_template.is_null());

View File

@ -529,7 +529,6 @@ void CodeGenerator::LoadGlobalReceiver(Register scratch) {
// that we have the INSIDE_TYPEOF typeof state. => Need to handle global
// variables w/o reference errors elsewhere.
void CodeGenerator::LoadTypeofExpression(Expression* x) {
Variable* variable = x->AsVariableProxy()->AsVariable();
if (variable != NULL && !variable->is_this() && variable->is_global()) {
// NOTE: This is somewhat nasty. We force the compiler to load

View File

@ -552,8 +552,8 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
mov(scratch, FieldOperand(scratch, offset));
mov(scratch, FieldOperand(scratch, GlobalObject::kGlobalContextOffset));
// Check the context is a global context.
// Check the context is a global context.
if (FLAG_debug_code) {
push(scratch);
// Read the first word and compare to global_context_map.
@ -571,7 +571,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
// as a temporary register.
//
// TODO(119): avoid push(holder_reg)/pop(holder_reg)
push(holder_reg);
push(holder_reg);
// Check that the security token in the calling global object is
// compatible with the security token in the receiving global
// object.
@ -587,14 +587,14 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
mov(holder_reg, FieldOperand(holder_reg, HeapObject::kMapOffset));
cmp(holder_reg, Factory::global_context_map());
Check(equal, "JSGlobalObject::global_context should be a global context.");
pop(holder_reg);
pop(holder_reg);
}
int token_offset = Context::kHeaderSize +
Context::SECURITY_TOKEN_INDEX * kPointerSize;
mov(scratch, FieldOperand(scratch, token_offset));
cmp(scratch, FieldOperand(holder_reg, token_offset));
pop(holder_reg);
pop(holder_reg);
j(not_equal, miss, not_taken);
bind(&same_contexts);

View File

@ -572,8 +572,8 @@ void JSGlobalProxy::JSGlobalProxyVerify() {
JSObjectVerify();
VerifyObjectField(JSGlobalProxy::kContextOffset);
// Make sure that this object has no properties, elements.
CHECK(properties()->length() == 0);
CHECK(elements()->length() == 0);
CHECK_EQ(0, properties()->length());
CHECK_EQ(0, elements()->length());
}

View File

@ -1499,7 +1499,7 @@ Object* JSObject::SetProperty(LookupResult* result,
Object* proto = GetPrototype();
if (proto->IsNull()) return value;
ASSERT(proto->IsJSGlobalObject());
return JSObject::cast(proto)->SetProperty(result, name, value, attributes);
return JSObject::cast(proto)->SetProperty(result, name, value, attributes);
}
if (result->IsNotFound() || !result->IsProperty()) {

View File

@ -48,7 +48,7 @@
// - GlobalObject
// - JSGlobalObject
// - JSBuiltinsObject
// _ JSGlobalProxy
// _ JSGlobalProxy
// - JSValue
// - Script
// - Array

View File

@ -464,7 +464,7 @@ void Top::ReportFailedAccessCheck(JSObject* receiver, v8::AccessType type) {
}
enum MayAccessDecision{
enum MayAccessDecision {
YES, NO, UNKNOWN
};
@ -481,7 +481,7 @@ static MayAccessDecision MayAccessPreCheck(JSObject* receiver,
// Get the global context of current top context.
// avoid using Top::global_context() because it uses Handle.
Context* global_context = Top::context()->global()->global_context();
if (receiver_context == global_context) return YES;
if (receiver_context == global_context) return YES;
if (Context::cast(receiver_context)->security_token() ==
global_context->security_token())

View File

@ -3273,7 +3273,7 @@ TEST(ContextDetachGlobal) {
// Check that env3 is not accessible from env1
{
Local<Value> r = global3->Get(v8_str("prop2"));
CHECK(r->IsUndefined());
CHECK(r->IsUndefined());
}
env2.Dispose();