Adding 'static const' for arg numbers used with CallCFunction.
authorserya@chromium.org <serya@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 25 Feb 2010 13:06:05 +0000 (13:06 +0000)
committerserya@chromium.org <serya@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 25 Feb 2010 13:06:05 +0000 (13:06 +0000)
Review URL: http://codereview.chromium.org/660078

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

src/arm/regexp-macro-assembler-arm.cc
src/ia32/codegen-ia32.cc
src/ia32/regexp-macro-assembler-ia32.cc
src/x64/codegen-x64.cc
src/x64/regexp-macro-assembler-x64.cc

index 9dd3b9326647c34b31350d97b3a113855b918042..f621be47be2042e92bae539cf195c53ad4f7b21d 100644 (file)
@@ -765,7 +765,7 @@ Handle<Object> RegExpMacroAssemblerARM::GetCode(Handle<String> source) {
     Label grow_failed;
 
     // Call GrowStack(backtrack_stackpointer())
-    int num_arguments = 2;
+    static const int num_arguments = 2;
     FrameAlign(num_arguments, r0);
     __ mov(r0, backtrack_stackpointer());
     __ add(r1, frame_pointer(), Operand(kStackHighEnd));
@@ -966,7 +966,7 @@ void RegExpMacroAssemblerARM::WriteStackPointerToRegister(int reg) {
 // Private methods:
 
 void RegExpMacroAssemblerARM::CallCheckStackGuardState(Register scratch) {
-  int num_arguments = 3;
+  static const int num_arguments = 3;
   FrameAlign(num_arguments, scratch);
   // RegExp code frame pointer.
   __ mov(r2, frame_pointer());
index 816f16ad2a9452a8945ea52fb582b367e352292f..d8c317f61ac6cd2aea9f07557e3db274461bddfc 100644 (file)
@@ -5743,7 +5743,7 @@ void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) {
   ASSERT(args->length() == 0);
   frame_->SpillAll();
 
-  int num_arguments = 0;
+  static const int num_arguments = 0;
   __ PrepareCallCFunction(num_arguments, eax);
 
   // Call V8::RandomPositiveSmi().
index e5edf74f5ebfa4f4c5dbd03830a24128d30bcd0a..74b9d129cc6643c5a3a9801c8eda3c53bd7785e1 100644 (file)
@@ -324,7 +324,7 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase(
     __ push(backtrack_stackpointer());
     __ push(ebx);
 
-    const int argument_count = 3;
+    static const int argument_count = 3;
     __ PrepareCallCFunction(argument_count, ecx);
     // Put arguments into allocated stack area, last argument highest on stack.
     // Parameters are
@@ -784,7 +784,7 @@ Handle<Object> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
     __ push(edi);
 
     // Call GrowStack(backtrack_stackpointer())
-    int num_arguments = 2;
+    static const int num_arguments = 2;
     __ PrepareCallCFunction(num_arguments, ebx);
     __ lea(eax, Operand(ebp, kStackHighEnd));
     __ mov(Operand(esp, 1 * kPointerSize), eax);
@@ -951,7 +951,7 @@ void RegExpMacroAssemblerIA32::WriteStackPointerToRegister(int reg) {
 // Private methods:
 
 void RegExpMacroAssemblerIA32::CallCheckStackGuardState(Register scratch) {
-  int num_arguments = 3;
+  static const int num_arguments = 3;
   __ PrepareCallCFunction(num_arguments, scratch);
   // RegExp code frame pointer.
   __ mov(Operand(esp, 2 * kPointerSize), ebp);
index c8dd0b66f8cfd0f9041944717def6b32240bbe3e..bf8bee47125242a01c1de7cd84d25ccb9142485d 100644 (file)
@@ -3958,7 +3958,7 @@ void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) {
   frame_->SpillAll();
   __ push(rsi);
 
-  int num_arguments = 0;
+  static const int num_arguments = 0;
   __ PrepareCallCFunction(num_arguments);
 
   // Call V8::RandomPositiveSmi().
index 026301b2afddc1acaf1bc9f8f614860fd6ff802a..6e7d9c9e074fda0b487f6df5b1ef950f2e6bc3ea 100644 (file)
@@ -335,7 +335,7 @@ void RegExpMacroAssemblerX64::CheckNotBackReferenceIgnoreCase(
 #endif
     __ push(backtrack_stackpointer());
 
-    int num_arguments = 3;
+    static const int num_arguments = 3;
     __ PrepareCallCFunction(num_arguments);
 
     // Put arguments into parameter registers. Parameters are
@@ -849,7 +849,7 @@ Handle<Object> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
 #endif
 
     // Call GrowStack(backtrack_stackpointer())
-    int num_arguments = 2;
+    static const int num_arguments = 2;
     __ PrepareCallCFunction(num_arguments);
 #ifdef _WIN64
     // Microsoft passes parameters in rcx, rdx.
@@ -1029,7 +1029,7 @@ void RegExpMacroAssemblerX64::WriteStackPointerToRegister(int reg) {
 void RegExpMacroAssemblerX64::CallCheckStackGuardState() {
   // This function call preserves no register values. Caller should
   // store anything volatile in a C call or overwritten by this function.
-  int num_arguments = 3;
+  static const int num_arguments = 3;
   __ PrepareCallCFunction(num_arguments);
 #ifdef _WIN64
   // Second argument: Code* of self. (Do this before overwriting r8).