From d525ddbed1f2992666393d85bd3958e9de905545 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Wed, 25 Jul 2012 14:27:14 +0000 Subject: [PATCH] Fix static initializer check. 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 | 4 ---- src/full-codegen.h | 16 ++++++++++++++-- src/ia32/full-codegen-ia32.cc | 4 ---- src/mips/full-codegen-mips.cc | 4 ---- src/x64/full-codegen-x64.cc | 4 ---- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index 750e5cee33..4dcc21d41a 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"); diff --git a/src/full-codegen.h b/src/full-codegen.h index 0c32919324..eca36b4470 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; diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index 4ad0a8d5fd..75253c07a4 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"); diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 8e4ad98e31..dd4b70ea86 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 diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index efd369b5da..344905e212 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");