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");