Author: [email protected]
Date: Tue Jul  7 04:41:21 2009
New Revision: 2371

Modified:
    branches/bleeding_edge/src/bootstrapper.cc
    branches/bleeding_edge/src/handles.cc
    branches/bleeding_edge/src/handles.h
    branches/bleeding_edge/src/ia32/assembler-ia32.cc
    branches/bleeding_edge/src/parser.cc

Log:
Change a few sites where the Handle<T>(NULL) constructor is used so
that they use the static Handle<T>::null() member function instead.

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

Modified: branches/bleeding_edge/src/bootstrapper.cc
==============================================================================
--- branches/bleeding_edge/src/bootstrapper.cc  (original)
+++ branches/bleeding_edge/src/bootstrapper.cc  Tue Jul  7 04:41:21 2009
@@ -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;

Modified: branches/bleeding_edge/src/handles.cc
==============================================================================
--- branches/bleeding_edge/src/handles.cc       (original)
+++ branches/bleeding_edge/src/handles.cc       Tue Jul  7 04:41:21 2009
@@ -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.

Modified: branches/bleeding_edge/src/handles.h
==============================================================================
--- branches/bleeding_edge/src/handles.h        (original)
+++ branches/bleeding_edge/src/handles.h        Tue Jul  7 04:41:21 2009
@@ -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 {

Modified: branches/bleeding_edge/src/ia32/assembler-ia32.cc
==============================================================================
--- branches/bleeding_edge/src/ia32/assembler-ia32.cc   (original)
+++ branches/bleeding_edge/src/ia32/assembler-ia32.cc   Tue Jul  7 04:41:21  
2009
@@ -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"));

Modified: branches/bleeding_edge/src/parser.cc
==============================================================================
--- branches/bleeding_edge/src/parser.cc        (original)
+++ branches/bleeding_edge/src/parser.cc        Tue Jul  7 04:41:21 2009
@@ -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
-~----------~----~----~----~------~----~------~--~---

Reply via email to