From 648f6d21c63e065770023ff11e3d612793689fbe Mon Sep 17 00:00:00 2001 From: "feng@chromium.org" Date: Tue, 21 Oct 2008 20:08:49 +0000 Subject: [PATCH] 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 --- src/api.cc | 2 +- src/bootstrapper.cc | 8 ++++---- src/codegen-ia32.cc | 1 - src/macro-assembler-ia32.cc | 10 +++++----- src/objects-debug.cc | 4 ++-- src/objects.cc | 2 +- src/objects.h | 2 +- src/top.cc | 4 ++-- test/cctest/test-api.cc | 2 +- 9 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/api.cc b/src/api.cc index 5c8075d..9a662f4 100644 --- a/src/api.cc +++ b/src/api.cc @@ -2255,7 +2255,7 @@ Persistent v8::Context::New( i::Handle 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( diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index 92edd1f..7aba969 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -543,7 +543,7 @@ void Genesis::CreateRoots(v8::Handle global_template, if (!proto_template->IsUndefined()) { js_global_template = Handle::cast(proto_template); - } + } } if (js_global_template.is_null()) { @@ -1195,7 +1195,7 @@ bool Genesis::ConfigureGlobalObjects( Handle js_global(JSObject::cast(global_context()->global())); if (!global_proxy_template.IsEmpty()) { - // Configure the global proxy object. + // Configure the global proxy object. Handle proxy_data = v8::Utils::OpenHandle(*global_proxy_template); if (!ConfigureApiObject(global_proxy, proxy_data)) return false; @@ -1204,7 +1204,7 @@ bool Genesis::ConfigureGlobalObjects( Handle proxy_constructor( FunctionTemplateInfo::cast(proxy_data->constructor())); if (!proxy_constructor->prototype_template()->IsUndefined()) { - Handle inner_data( + Handle 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 object, Handle object_template) { ASSERT(!object_template.is_null()); diff --git a/src/codegen-ia32.cc b/src/codegen-ia32.cc index 684fa37..c90a18b 100644 --- a/src/codegen-ia32.cc +++ b/src/codegen-ia32.cc @@ -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 diff --git a/src/macro-assembler-ia32.cc b/src/macro-assembler-ia32.cc index d0420c3..667ff40 100644 --- a/src/macro-assembler-ia32.cc +++ b/src/macro-assembler-ia32.cc @@ -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); diff --git a/src/objects-debug.cc b/src/objects-debug.cc index e68a0be..dc5cb60 100644 --- a/src/objects-debug.cc +++ b/src/objects-debug.cc @@ -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()); } diff --git a/src/objects.cc b/src/objects.cc index b0d3354..72a5e2e 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -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()) { diff --git a/src/objects.h b/src/objects.h index 3ecf37c..b59dfc0 100644 --- a/src/objects.h +++ b/src/objects.h @@ -48,7 +48,7 @@ // - GlobalObject // - JSGlobalObject // - JSBuiltinsObject -// _ JSGlobalProxy +// _ JSGlobalProxy // - JSValue // - Script // - Array diff --git a/src/top.cc b/src/top.cc index 19361a3..6dbb522 100644 --- a/src/top.cc +++ b/src/top.cc @@ -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()) diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index 1fb2b81..55a844f 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -3273,7 +3273,7 @@ TEST(ContextDetachGlobal) { // Check that env3 is not accessible from env1 { Local r = global3->Get(v8_str("prop2")); - CHECK(r->IsUndefined()); + CHECK(r->IsUndefined()); } env2.Dispose(); -- 2.7.4