Reviewers: Erik Corry,

Message:
Alternative fix to http://codereview.chromium.org/17609
Please review.

Description:
Unsigned number can't be negated in the VisualStudio compiler.
Fixed a few earlier review comments that had slipped through.

Please review this at http://codereview.chromium.org/17640

Affected files:
   M src/regexp-macro-assembler-ia32.h
   M src/regexp-macro-assembler-ia32.cc
   M test/cctest/test-regexp.cc


Index: src/regexp-macro-assembler-ia32.cc
diff --git a/src/regexp-macro-assembler-ia32.cc  
b/src/regexp-macro-assembler-ia32.cc
index  
56846af3d58bff687e6c513fb17aece7709411d5..b21b5d806797b344f36c6b0c88970a89e7e9aeed
  
100644
--- a/src/regexp-macro-assembler-ia32.cc
+++ b/src/regexp-macro-assembler-ia32.cc
@@ -618,8 +618,9 @@ Handle<Object>  
RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
    __ sub(ecx, Operand::StaticVariable(stack_guard_limit));
    // Handle it if the stack pointer is already below the stack limit.
    __ j(below_equal, &stack_limit_hit, not_taken);
-  // Check if there is room for num_registers + ebp above the stack limit.
-  __ cmp(ecx, (num_registers_ + 1) * kPointerSize);
+  // Check if there is room for the variable number of registers above
+  // the stack limit.
+  __ cmp(ecx, num_registers_ * kPointerSize);
    __ j(above_equal, &stack_ok, taken);
    // Exit with exception.
    __ mov(eax, EXCEPTION);
Index: src/regexp-macro-assembler-ia32.h
diff --git a/src/regexp-macro-assembler-ia32.h  
b/src/regexp-macro-assembler-ia32.h
index  
1fdbf9870544f0c015bd3cc243aaf98c835f8282..88318212937d6cb26b95949851fb1c15305535cc
  
100644
--- a/src/regexp-macro-assembler-ia32.h
+++ b/src/regexp-macro-assembler-ia32.h
@@ -178,7 +178,7 @@ class RegExpMacroAssemblerIA32: public  
RegExpMacroAssembler {
    inline Register backtrack_stackpointer() { return ecx; }

    // Byte size of chars in the string to match (decided by the Mode  
argument)
-  inline size_t char_size() { return static_cast<size_t>(mode_); }
+  inline int char_size() { return static_cast<int>(mode_); }

    // Equivalent to a conditional branch to the label, unless the label
    // is NULL, in which case it is a conditional Backtrack.
@@ -225,7 +225,7 @@ class RegExpMacroAssemblerIA32: public  
RegExpMacroAssembler {
    // constants.
    ByteArrayProvider constants_;

-  // Which mode to generate code for (ASCII or UTF16).
+  // Which mode to generate code for (ASCII or UC16).
    Mode mode_;

    // One greater than maximal register index actually used.
Index: test/cctest/test-regexp.cc
diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc
index  
bb94d350cae0c0ba631c23949955551baff37034..986785ec789749a0ce34d5343d4e34e250483702
  
100644
--- a/test/cctest/test-regexp.cc
+++ b/test/cctest/test-regexp.cc
@@ -1055,8 +1055,6 @@ TEST(MacroAssemblerIA32AtStart) {
  }


-
-
  TEST(MacroAssemblerIA32BackRefNoCase) {
    v8::V8::Initialize();
    ContextInitializer initializer;



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

Reply via email to