Author: [email protected]
Date: Fri Mar 20 05:58:14 2009
New Revision: 1560

Added:
    branches/bleeding_edge/src/register-allocator-inl.h
Modified:
    branches/bleeding_edge/src/codegen-arm.cc
    branches/bleeding_edge/src/codegen-ia32.cc
    branches/bleeding_edge/src/codegen.cc
    branches/bleeding_edge/src/disassembler.cc
    branches/bleeding_edge/src/jump-target-arm.cc
    branches/bleeding_edge/src/jump-target-ia32.cc
    branches/bleeding_edge/src/jump-target.cc
    branches/bleeding_edge/src/register-allocator-arm.cc
    branches/bleeding_edge/src/register-allocator-ia32.cc
    branches/bleeding_edge/src/register-allocator.cc
    branches/bleeding_edge/src/register-allocator.h
    branches/bleeding_edge/src/virtual-frame-arm.cc
    branches/bleeding_edge/src/virtual-frame-ia32.cc
    branches/bleeding_edge/src/virtual-frame.cc

Log:
Inline the Result::Unuse member function and change the Result
destructor to no longer invalidate the result.

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

Modified: branches/bleeding_edge/src/codegen-arm.cc
==============================================================================
--- branches/bleeding_edge/src/codegen-arm.cc   (original)
+++ branches/bleeding_edge/src/codegen-arm.cc   Fri Mar 20 05:58:14 2009
@@ -30,9 +30,10 @@
  #include "bootstrapper.h"
  #include "codegen-inl.h"
  #include "debug.h"
+#include "register-allocator-inl.h"
  #include "runtime.h"
  #include "scopes.h"
-#include "virtual-frame.h"
+

  namespace v8 { namespace internal {


Modified: branches/bleeding_edge/src/codegen-ia32.cc
==============================================================================
--- branches/bleeding_edge/src/codegen-ia32.cc  (original)
+++ branches/bleeding_edge/src/codegen-ia32.cc  Fri Mar 20 05:58:14 2009
@@ -30,9 +30,9 @@
  #include "bootstrapper.h"
  #include "codegen-inl.h"
  #include "debug.h"
+#include "register-allocator-inl.h"
  #include "runtime.h"
  #include "scopes.h"
-#include "virtual-frame.h"

  namespace v8 { namespace internal {


Modified: branches/bleeding_edge/src/codegen.cc
==============================================================================
--- branches/bleeding_edge/src/codegen.cc       (original)
+++ branches/bleeding_edge/src/codegen.cc       Fri Mar 20 05:58:14 2009
@@ -31,10 +31,10 @@
  #include "codegen-inl.h"
  #include "debug.h"
  #include "prettyprinter.h"
+#include "register-allocator-inl.h"
  #include "runtime.h"
  #include "scopeinfo.h"
  #include "stub-cache.h"
-#include "virtual-frame.h"

  namespace v8 { namespace internal {


Modified: branches/bleeding_edge/src/disassembler.cc
==============================================================================
--- branches/bleeding_edge/src/disassembler.cc  (original)
+++ branches/bleeding_edge/src/disassembler.cc  Fri Mar 20 05:58:14 2009
@@ -28,7 +28,7 @@
  #include "v8.h"

  #include "code-stubs.h"
-#include "codegen.h"
+#include "codegen-inl.h"
  #include "debug.h"
  #include "disasm.h"
  #include "disassembler.h"

Modified: branches/bleeding_edge/src/jump-target-arm.cc
==============================================================================
--- branches/bleeding_edge/src/jump-target-arm.cc       (original)
+++ branches/bleeding_edge/src/jump-target-arm.cc       Fri Mar 20 05:58:14 2009
@@ -27,8 +27,8 @@

  #include "v8.h"

-#include "codegen.h"
-#include "virtual-frame.h"
+#include "codegen-inl.h"
+#include "register-allocator-inl.h"

  namespace v8 { namespace internal {


Modified: branches/bleeding_edge/src/jump-target-ia32.cc
==============================================================================
--- branches/bleeding_edge/src/jump-target-ia32.cc      (original)
+++ branches/bleeding_edge/src/jump-target-ia32.cc      Fri Mar 20 05:58:14 2009
@@ -27,8 +27,8 @@

  #include "v8.h"

-#include "codegen.h"
-#include "virtual-frame.h"
+#include "codegen-inl.h"
+#include "register-allocator-inl.h"

  namespace v8 { namespace internal {


Modified: branches/bleeding_edge/src/jump-target.cc
==============================================================================
--- branches/bleeding_edge/src/jump-target.cc   (original)
+++ branches/bleeding_edge/src/jump-target.cc   Fri Mar 20 05:58:14 2009
@@ -27,8 +27,8 @@

  #include "v8.h"

-#include "codegen.h"
-#include "virtual-frame.h"
+#include "codegen-inl.h"
+#include "register-allocator-inl.h"

  namespace v8 { namespace internal {


Modified: branches/bleeding_edge/src/register-allocator-arm.cc
==============================================================================
--- branches/bleeding_edge/src/register-allocator-arm.cc        (original)
+++ branches/bleeding_edge/src/register-allocator-arm.cc        Fri Mar 20  
05:58:14 2009
@@ -27,8 +27,8 @@

  #include "v8.h"

-#include "codegen.h"
-#include "register-allocator.h"
+#include "codegen-inl.h"
+#include "register-allocator-inl.h"

  namespace v8 { namespace internal {


Modified: branches/bleeding_edge/src/register-allocator-ia32.cc
==============================================================================
--- branches/bleeding_edge/src/register-allocator-ia32.cc       (original)
+++ branches/bleeding_edge/src/register-allocator-ia32.cc       Fri Mar 20  
05:58:14 2009
@@ -27,8 +27,8 @@

  #include "v8.h"

-#include "codegen.h"
-#include "virtual-frame.h"
+#include "codegen-inl.h"
+#include "register-allocator-inl.h"

  namespace v8 { namespace internal {


Added: branches/bleeding_edge/src/register-allocator-inl.h
==============================================================================
--- (empty file)
+++ branches/bleeding_edge/src/register-allocator-inl.h Fri Mar 20 05:58:14  
2009
@@ -0,0 +1,48 @@
+// Copyright 2009 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_REGISTER_ALLOCATOR_INL_H_
+#define V8_REGISTER_ALLOCATOR_INL_H_
+
+#include "virtual-frame.h"
+
+namespace v8 { namespace internal {
+
+Result::~Result() {
+  if (is_register()) cgen_->allocator()->Unuse(reg());
+}
+
+
+void Result::Unuse() {
+  if (is_register()) cgen_->allocator()->Unuse(reg());
+  type_ = INVALID;
+}
+
+
+} }  // namespace v8::internal
+
+#endif  // V8_REGISTER_ALLOCATOR_INL_H_

Modified: branches/bleeding_edge/src/register-allocator.cc
==============================================================================
--- branches/bleeding_edge/src/register-allocator.cc    (original)
+++ branches/bleeding_edge/src/register-allocator.cc    Fri Mar 20 05:58:14  
2009
@@ -27,8 +27,8 @@

  #include "v8.h"

-#include "codegen.h"
-#include "virtual-frame.h"
+#include "codegen-inl.h"
+#include "register-allocator-inl.h"

  namespace v8 { namespace internal {

@@ -56,14 +56,6 @@
    } else {
      ASSERT(!is_valid());
    }
-}
-
-
-void Result::Unuse() {
-  if (is_register()) {
-    cgen_->allocator()->Unuse(reg());
-  }
-  type_ = INVALID;
  }



Modified: branches/bleeding_edge/src/register-allocator.h
==============================================================================
--- branches/bleeding_edge/src/register-allocator.h     (original)
+++ branches/bleeding_edge/src/register-allocator.h     Fri Mar 20 05:58:14 2009
@@ -73,9 +73,9 @@
      return *this;
    }

-  ~Result() { Unuse(); }
+  inline ~Result();

-  void Unuse();
+  inline void Unuse();

    Type type() const { return type_; }


Modified: branches/bleeding_edge/src/virtual-frame-arm.cc
==============================================================================
--- branches/bleeding_edge/src/virtual-frame-arm.cc     (original)
+++ branches/bleeding_edge/src/virtual-frame-arm.cc     Fri Mar 20 05:58:14 2009
@@ -28,8 +28,8 @@
  #include "v8.h"

  #include "codegen-inl.h"
+#include "register-allocator-inl.h"
  #include "scopes.h"
-#include "virtual-frame.h"

  namespace v8 { namespace internal {


Modified: branches/bleeding_edge/src/virtual-frame-ia32.cc
==============================================================================
--- branches/bleeding_edge/src/virtual-frame-ia32.cc    (original)
+++ branches/bleeding_edge/src/virtual-frame-ia32.cc    Fri Mar 20 05:58:14  
2009
@@ -28,8 +28,8 @@
  #include "v8.h"

  #include "codegen-inl.h"
+#include "register-allocator-inl.h"
  #include "scopes.h"
-#include "virtual-frame.h"

  namespace v8 { namespace internal {


Modified: branches/bleeding_edge/src/virtual-frame.cc
==============================================================================
--- branches/bleeding_edge/src/virtual-frame.cc (original)
+++ branches/bleeding_edge/src/virtual-frame.cc Fri Mar 20 05:58:14 2009
@@ -27,9 +27,8 @@

  #include "v8.h"

-#include "codegen.h"
  #include "codegen-inl.h"
-#include "virtual-frame.h"
+#include "register-allocator-inl.h"

  namespace v8 { namespace internal {


--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to