Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: src/macro-assembler.h

Issue 1302293002: Remove code.h header and move ParameterCount class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/globals.h ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « src/globals.h ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698