Reviewers: Benedikt Meurer,
Description:
Remove code.h header and move ParameterCount class.
[email protected]
Please review this at https://codereview.chromium.org/1302293002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+30, -62 lines):
M BUILD.gn
D src/code.h
M src/globals.h
M src/macro-assembler.h
M tools/gyp/v8.gyp
Index: src/code.h
diff --git a/src/code.h b/src/code.h
deleted file mode 100644
index
a0639e8deb8ae4e946e1e35a330aea03eee7a895..0000000000000000000000000000000000000000
--- a/src/code.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_CODE_H_
-#define V8_CODE_H_
-
-#include "src/allocation.h"
-#include "src/handles.h"
-#include "src/objects.h"
-
-namespace v8 {
-namespace internal {
-
-
-// Wrapper class for passing expected and actual parameter counts as
-// either registers or immediate values. Used to make sure that the
-// caller provides exactly the expected number of parameters to the
-// callee.
-class ParameterCount BASE_EMBEDDED {
- public:
- explicit ParameterCount(Register reg)
- : reg_(reg), immediate_(0) { }
- explicit ParameterCount(int immediate)
- : reg_(no_reg), immediate_(immediate) { }
- explicit ParameterCount(Handle<JSFunction> f)
- : reg_(no_reg),
- immediate_(f->shared()->internal_formal_parameter_count()) {}
-
- bool is_reg() const { return !reg_.is(no_reg); }
- bool is_immediate() const { return !is_reg(); }
-
- Register reg() const {
- DCHECK(is_reg());
- return reg_;
- }
- int immediate() const {
- DCHECK(is_immediate());
- return immediate_;
- }
-
- private:
- const Register reg_;
- const int immediate_;
-
- DISALLOW_IMPLICIT_CONSTRUCTORS(ParameterCount);
-};
-
-
-} } // namespace v8::internal
-
-#endif // V8_CODE_H_
Index: BUILD.gn
diff --git a/BUILD.gn b/BUILD.gn
index
f8d042c06490f74c638e8fdb53e0eba9055331df..03f7d545a03da4577a7f5b8947f5fb1eb88c449c
100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -682,7 +682,6 @@ source_set("v8_base") {
"src/code-stubs.cc",
"src/code-stubs.h",
"src/code-stubs-hydrogen.cc",
- "src/code.h",
"src/codegen.cc",
"src/codegen.h",
"src/compilation-cache.cc",
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index
5f1070382c199909fa87d7438ef86495575d3fad..b3ece830374eaf10a159834f67f9ed89884cda25
100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -431,6 +431,7 @@ class MarkCompactCollector;
class NewSpace;
class Object;
class OldSpace;
+class ParameterCount;
class Foreign;
class Scope;
class ScopeInfo;
Index: src/macro-assembler.h
diff --git a/src/macro-assembler.h b/src/macro-assembler.h
index
5ea965751564b4055e2ae198926b5d8ca783ad88..22728f42e0f15f724073d8aa927627bcc0115f9c
100644
--- a/src/macro-assembler.h
+++ b/src/macro-assembler.h
@@ -39,20 +39,17 @@ const int kInvalidProtoDepth = -1;
#include "src/assembler.h"
#include "src/ia32/assembler-ia32.h"
#include "src/ia32/assembler-ia32-inl.h"
-#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/ia32/macro-assembler-ia32.h"
#elif V8_TARGET_ARCH_X64
#include "src/assembler.h"
#include "src/x64/assembler-x64.h"
#include "src/x64/assembler-x64-inl.h"
-#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/x64/macro-assembler-x64.h"
#elif V8_TARGET_ARCH_ARM64
#include "src/arm64/constants-arm64.h"
#include "src/assembler.h"
#include "src/arm64/assembler-arm64.h" // NOLINT
#include "src/arm64/assembler-arm64-inl.h"
-#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/arm64/macro-assembler-arm64.h" // NOLINT
#include "src/arm64/macro-assembler-arm64-inl.h"
#elif V8_TARGET_ARCH_ARM
@@ -60,34 +57,29 @@ const int kInvalidProtoDepth = -1;
#include "src/assembler.h"
#include "src/arm/assembler-arm.h" // NOLINT
#include "src/arm/assembler-arm-inl.h"
-#include "src/code.h" // NOLINT, must be after
assembler_*.h
#include "src/arm/macro-assembler-arm.h" // NOLINT
#elif V8_TARGET_ARCH_PPC
#include "src/ppc/constants-ppc.h"
#include "src/assembler.h" // NOLINT
#include "src/ppc/assembler-ppc.h" // NOLINT
#include "src/ppc/assembler-ppc-inl.h"
-#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/ppc/macro-assembler-ppc.h"
#elif V8_TARGET_ARCH_MIPS
#include "src/mips/constants-mips.h"
#include "src/assembler.h" // NOLINT
#include "src/mips/assembler-mips.h" // NOLINT
#include "src/mips/assembler-mips-inl.h"
-#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/mips/macro-assembler-mips.h"
#elif V8_TARGET_ARCH_MIPS64
#include "src/mips64/constants-mips64.h"
#include "src/assembler.h" // NOLINT
#include "src/mips64/assembler-mips64.h" // NOLINT
#include "src/mips64/assembler-mips64-inl.h"
-#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/mips64/macro-assembler-mips64.h"
#elif V8_TARGET_ARCH_X87
#include "src/assembler.h"
#include "src/x87/assembler-x87.h"
#include "src/x87/assembler-x87-inl.h"
-#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/x87/macro-assembler-x87.h"
#else
#error Unsupported target architecture.
@@ -245,6 +237,35 @@ class Comment {
#endif // DEBUG
+// Wrapper class for passing expected and actual parameter counts as
+// either registers or immediate values. Used to make sure that the
+// caller provides exactly the expected number of parameters to the
+// callee.
+class ParameterCount BASE_EMBEDDED {
+ public:
+ explicit ParameterCount(Register reg) : reg_(reg), immediate_(0) {}
+ explicit ParameterCount(int imm) : reg_(no_reg), immediate_(imm) {}
+
+ bool is_reg() const { return !reg_.is(no_reg); }
+ bool is_immediate() const { return !is_reg(); }
+
+ Register reg() const {
+ DCHECK(is_reg());
+ return reg_;
+ }
+ int immediate() const {
+ DCHECK(is_immediate());
+ return immediate_;
+ }
+
+ private:
+ const Register reg_;
+ const int immediate_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ParameterCount);
+};
+
+
class AllocationUtils {
public:
static ExternalReference GetAllocationTopReference(
Index: tools/gyp/v8.gyp
diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp
index
bebcbe2ae3b4a338d9ca30652ba714e420e9a13a..caca437a7ebb53117c20d5db72ec3c0a31c7d5a2
100644
--- a/tools/gyp/v8.gyp
+++ b/tools/gyp/v8.gyp
@@ -439,7 +439,6 @@
'../../src/code-stubs.cc',
'../../src/code-stubs.h',
'../../src/code-stubs-hydrogen.cc',
- '../../src/code.h',
'../../src/codegen.cc',
'../../src/codegen.h',
'../../src/compilation-cache.cc',
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.