Reviewers: Jakob,

Description:
Fix static initializer check.


[email protected]
BUG=
TEST=


Please review this at https://chromiumcodereview.appspot.com/10824013/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/arm/full-codegen-arm.cc
  M src/full-codegen.h
  M src/ia32/full-codegen-ia32.cc
  M src/mips/full-codegen-mips.cc
  M src/x64/full-codegen-x64.cc


Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index 750e5cee33ee82f84c6ba7e26e2bd5d5622621ed..4dcc21d41a7aa2b63021a569f0844923b6ab2177 100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -338,10 +338,6 @@ void FullCodeGenerator::EmitProfilingCounterReset() {
 }


-const int FullCodeGenerator::kMaxBackEdgeWeight = 127;
-const int FullCodeGenerator::kBackEdgeDistanceUnit = 142;
-
-
 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
                                        Label* back_edge_target) {
   Comment cmnt(masm_, "[ Stack check");
Index: src/full-codegen.h
diff --git a/src/full-codegen.h b/src/full-codegen.h
index 0c3291932420836b5fa82086ad88806bfb78ca20..eca36b4470bf4b8e817f0788126df20149361405 100644
--- a/src/full-codegen.h
+++ b/src/full-codegen.h
@@ -113,8 +113,20 @@ class FullCodeGenerator: public AstVisitor {

   Zone* zone() const { return zone_; }

-  static const int kMaxBackEdgeWeight;
-  static const int kBackEdgeDistanceUnit;
+  static const int kMaxBackEdgeWeight = 127;
+
+#if V8_TARGET_ARCH_IA32
+  static const int kBackEdgeDistanceUnit = 100;
+#elif V8_TARGET_ARCH_X64
+  static const int kBackEdgeDistanceUnit = 162;
+#elif V8_TARGET_ARCH_ARM
+  static const int kBackEdgeDistanceUnit = 142;
+#elif V8_TARGET_ARCH_MIPS
+  static const int kBackEdgeDistanceUnit = 142;
+#else
+#error Unsupported target architecture.
+#endif
+

  private:
   class Breakable;
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index 4ad0a8d5fd386a51473a8f4f5ea312806d15cd9d..75253c07a462c60b461e7d0d32498fc667870762 100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -325,10 +325,6 @@ void FullCodeGenerator::EmitProfilingCounterReset() {
 }


-const int FullCodeGenerator::kMaxBackEdgeWeight = 127;
-const int FullCodeGenerator::kBackEdgeDistanceUnit = 100;
-
-
 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
                                        Label* back_edge_target) {
   Comment cmnt(masm_, "[ Stack check");
Index: src/mips/full-codegen-mips.cc
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
index 8e4ad98e31ff570230dd38cd0d83a8efe9611ad0..dd4b70ea8673187ebb0870c49bc9bee12091645f 100644
--- a/src/mips/full-codegen-mips.cc
+++ b/src/mips/full-codegen-mips.cc
@@ -340,10 +340,6 @@ void FullCodeGenerator::EmitProfilingCounterReset() {
 }


-const int FullCodeGenerator::kMaxBackEdgeWeight = 127;
-const int FullCodeGenerator::kBackEdgeDistanceUnit = 142;
-
-
 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
                                        Label* back_edge_target) {
// The generated code is used in Deoptimizer::PatchStackCheckCodeAt so we need
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index efd369b5daf3a552975fe55c7cf7dd78bc4d5158..344905e212081be287fdbd33d692ebefc9361399 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -321,10 +321,6 @@ void FullCodeGenerator::EmitProfilingCounterReset() {
 }


-const int FullCodeGenerator::kMaxBackEdgeWeight = 127;
-const int FullCodeGenerator::kBackEdgeDistanceUnit = 162;
-
-
 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
                                        Label* back_edge_target) {
   Comment cmnt(masm_, "[ Stack check");


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

Reply via email to