From 0fad6259919e37c6f107ffeb859692bdc72578be Mon Sep 17 00:00:00 2001 From: "lrn@chromium.org" Date: Tue, 13 Jan 2009 09:23:26 +0000 Subject: [PATCH] Unsigned number can't be negated in the VisualStudio compiler. Fixed a few earlier review comments that had slipped through. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1060 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/regexp-macro-assembler-ia32.cc | 5 +++-- src/regexp-macro-assembler-ia32.h | 4 ++-- test/cctest/test-regexp.cc | 2 -- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/regexp-macro-assembler-ia32.cc b/src/regexp-macro-assembler-ia32.cc index 56846af3d..b21b5d806 100644 --- a/src/regexp-macro-assembler-ia32.cc +++ b/src/regexp-macro-assembler-ia32.cc @@ -618,8 +618,9 @@ Handle RegExpMacroAssemblerIA32::GetCode(Handle 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); diff --git a/src/regexp-macro-assembler-ia32.h b/src/regexp-macro-assembler-ia32.h index 1fdbf9870..883182129 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(mode_); } + inline int char_size() { return static_cast(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. diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc index bb94d350c..986785ec7 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; -- 2.34.1