Fix static initializer check.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 25 Jul 2012 14:27:14 +0000 (14:27 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 25 Jul 2012 14:27:14 +0000 (14:27 +0000)
R=jkummerow@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10824013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12187 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arm/full-codegen-arm.cc
src/full-codegen.h
src/ia32/full-codegen-ia32.cc
src/mips/full-codegen-mips.cc
src/x64/full-codegen-x64.cc

index 750e5ce..4dcc21d 100644 (file)
@@ -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 0c32919..eca36b4 100644 (file)
@@ -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 4ad0a8d..75253c0 100644 (file)
@@ -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 8e4ad98..dd4b70e 100644 (file)
@@ -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 efd369b..344905e 100644 (file)
@@ -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");