Reviewers: Kasper Lund, Description: Change a few sites where the Handle<T>(NULL) constructor is used so that they use the static Handle<T>::null() member function instead.
Please review this at http://codereview.chromium.org/155135 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/bootstrapper.cc M src/handles.h M src/handles.cc M src/ia32/assembler-ia32.cc M src/parser.cc Index: src/handles.cc =================================================================== --- src/handles.cc (revision 2368) +++ src/handles.cc (working copy) @@ -372,10 +372,10 @@ Handle<JSValue> GetScriptWrapper(Handle<Script> script) { - Handle<Object> cache(reinterpret_cast<Object**>(script->wrapper()->proxy())); - if (!cache.is_null()) { + if (script->wrapper()->proxy() != NULL) { // Return the script wrapper directly from the cache. - return Handle<JSValue>(JSValue::cast(*cache)); + return Handle<JSValue>( + reinterpret_cast<JSValue**>(script->wrapper()->proxy())); } // Construct a new script wrapper. Index: src/ia32/assembler-ia32.cc =================================================================== --- src/ia32/assembler-ia32.cc (revision 2368) +++ src/ia32/assembler-ia32.cc (working copy) @@ -114,8 +114,10 @@ CodeDesc desc; assm.GetCode(&desc); - Object* code = - Heap::CreateCode(desc, NULL, Code::ComputeFlags(Code::STUB), NULL); + Object* code = Heap::CreateCode(desc, + NULL, + Code::ComputeFlags(Code::STUB), + Handle<Code>::null()); if (!code->IsCode()) return; LOG(CodeCreateEvent(Logger::BUILTIN_TAG, Code::cast(code), "CpuFeatures::Probe")); Index: src/bootstrapper.cc =================================================================== --- src/bootstrapper.cc (revision 2368) +++ src/bootstrapper.cc (working copy) @@ -1556,7 +1556,7 @@ // will always do unlinking. previous_ = current_; current_ = this; - result_ = NULL; + result_ = Handle<Context>::null(); // If V8 isn't running and cannot be initialized, just return. if (!V8::IsRunning() && !V8::Initialize(NULL)) return; Index: src/handles.h =================================================================== --- src/handles.h (revision 2368) +++ src/handles.h (working copy) @@ -42,7 +42,7 @@ template<class T> class Handle { public: - INLINE(Handle(T** location)) { location_ = location; } + INLINE(Handle(T** location)) { location_ = location; } INLINE(explicit Handle(T* obj)); INLINE(Handle()) : location_(NULL) {} @@ -59,7 +59,7 @@ location_ = reinterpret_cast<T**>(handle.location()); } - INLINE(T* operator ->() const) { return operator*(); } + INLINE(T* operator ->() const) { return operator*(); } // Check if this handle refers to the exact same object as the other handle. bool is_identical_to(const Handle<T> other) const { Index: src/parser.cc =================================================================== --- src/parser.cc (revision 2369) +++ src/parser.cc (working copy) @@ -2045,7 +2045,7 @@ // 'continue' Identifier? ';' Expect(Token::CONTINUE, CHECK_OK); - Handle<String> label(static_cast<String**>(NULL)); + Handle<String> label = Handle<String>::null(); Token::Value tok = peek(); if (!scanner_.has_line_terminator_before_next() && tok != Token::SEMICOLON && tok != Token::RBRACE && tok != Token::EOS) { --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
