#if V8_TARGET_ARCH_IA32
#include "src/cpu-profiler.h"
-#include "src/unicode.h"
#include "src/log.h"
-#include "src/regexp-stack.h"
#include "src/macro-assembler.h"
#include "src/regexp-macro-assembler.h"
+#include "src/regexp-stack.h"
+#include "src/unicode.h"
+
#include "src/ia32/regexp-macro-assembler-ia32.h"
namespace v8 {
success_label_(),
backtrack_label_(),
exit_label_() {
- ASSERT_EQ(0, registers_to_save % 2);
+ DCHECK_EQ(0, registers_to_save % 2);
__ jmp(&entry_label_); // We'll write the entry code later.
__ bind(&start_label_); // And then continue from here.
}
void RegExpMacroAssemblerIA32::AdvanceRegister(int reg, int by) {
- ASSERT(reg >= 0);
- ASSERT(reg < num_registers_);
+ DCHECK(reg >= 0);
+ DCHECK(reg < num_registers_);
if (by != 0) {
__ add(register_location(reg), Immediate(by));
}
// Compute new value of character position after the matched part.
__ sub(edi, esi);
} else {
- ASSERT(mode_ == UC16);
+ DCHECK(mode_ == UC16);
// Save registers before calling C function.
__ push(esi);
__ push(edi);
__ movzx_b(eax, Operand(edx, 0));
__ cmpb_al(Operand(ebx, 0));
} else {
- ASSERT(mode_ == UC16);
+ DCHECK(mode_ == UC16);
__ movzx_w(eax, Operand(edx, 0));
__ cmpw_ax(Operand(ebx, 0));
}
uc16 minus,
uc16 mask,
Label* on_not_equal) {
- ASSERT(minus < String::kMaxUtf16CodeUnit);
+ DCHECK(minus < String::kMaxUtf16CodeUnit);
__ lea(eax, Operand(current_character(), -minus));
if (c == 0) {
__ test(eax, Immediate(mask));
__ cmp(current_character(), Immediate('z'));
BranchOrBacktrack(above, on_no_match);
}
- ASSERT_EQ(0, word_character_map[0]); // Character '\0' is not a word char.
+ DCHECK_EQ(0, word_character_map[0]); // Character '\0' is not a word char.
ExternalReference word_map = ExternalReference::re_word_character_map();
__ test_b(current_character(),
Operand::StaticArray(current_character(), times_1, word_map));
__ cmp(current_character(), Immediate('z'));
__ j(above, &done);
}
- ASSERT_EQ(0, word_character_map[0]); // Character '\0' is not a word char.
+ DCHECK_EQ(0, word_character_map[0]); // Character '\0' is not a word char.
ExternalReference word_map = ExternalReference::re_word_character_map();
__ test_b(current_character(),
Operand::StaticArray(current_character(), times_1, word_map));
} else {
Label done;
BranchOrBacktrack(below_equal, &done);
- ASSERT_EQ(UC16, mode_);
+ DCHECK_EQ(UC16, mode_);
// Compare original value to 0x2028 and 0x2029, using the already
// computed (current_char ^ 0x01 - 0x0b). I.e., check for
// 0x201d (0x2028 - 0x0b) or 0x201e.
Label* on_end_of_input,
bool check_bounds,
int characters) {
- ASSERT(cp_offset >= -1); // ^ and \b can look behind one character.
- ASSERT(cp_offset < (1<<30)); // Be sane! (And ensure negation works)
+ DCHECK(cp_offset >= -1); // ^ and \b can look behind one character.
+ DCHECK(cp_offset < (1<<30)); // Be sane! (And ensure negation works)
if (check_bounds) {
CheckPosition(cp_offset + characters - 1, on_end_of_input);
}
void RegExpMacroAssemblerIA32::SetRegister(int register_index, int to) {
- ASSERT(register_index >= num_saved_registers_); // Reserved for positions!
+ DCHECK(register_index >= num_saved_registers_); // Reserved for positions!
__ mov(register_location(register_index), Immediate(to));
}
void RegExpMacroAssemblerIA32::ClearRegisters(int reg_from, int reg_to) {
- ASSERT(reg_from <= reg_to);
+ DCHECK(reg_from <= reg_to);
__ mov(eax, Operand(ebp, kInputStartMinusOne));
for (int reg = reg_from; reg <= reg_to; reg++) {
__ mov(register_location(reg), eax);
// Current string.
bool is_ascii = subject->IsOneByteRepresentationUnderneath();
- ASSERT(re_code->instruction_start() <= *return_address);
- ASSERT(*return_address <=
+ DCHECK(re_code->instruction_start() <= *return_address);
+ DCHECK(*return_address <=
re_code->instruction_start() + re_code->instruction_size());
Object* result = isolate->stack_guard()->HandleInterrupts();
// be a sequential or external string with the same content.
// Update the start and end pointers in the stack frame to the current
// location (whether it has actually moved or not).
- ASSERT(StringShape(*subject_tmp).IsSequential() ||
+ DCHECK(StringShape(*subject_tmp).IsSequential() ||
StringShape(*subject_tmp).IsExternal());
// The original start address of the characters to match.
Operand RegExpMacroAssemblerIA32::register_location(int register_index) {
- ASSERT(register_index < (1<<30));
+ DCHECK(register_index < (1<<30));
if (num_registers_ <= register_index) {
num_registers_ = register_index + 1;
}
void RegExpMacroAssemblerIA32::Push(Register source) {
- ASSERT(!source.is(backtrack_stackpointer()));
+ DCHECK(!source.is(backtrack_stackpointer()));
// Notice: This updates flags, unlike normal Push.
__ sub(backtrack_stackpointer(), Immediate(kPointerSize));
__ mov(Operand(backtrack_stackpointer(), 0), source);
void RegExpMacroAssemblerIA32::Pop(Register target) {
- ASSERT(!target.is(backtrack_stackpointer()));
+ DCHECK(!target.is(backtrack_stackpointer()));
__ mov(target, Operand(backtrack_stackpointer(), 0));
// Notice: This updates flags, unlike normal Pop.
__ add(backtrack_stackpointer(), Immediate(kPointerSize));
} else if (characters == 2) {
__ movzx_w(current_character(), Operand(esi, edi, times_1, cp_offset));
} else {
- ASSERT(characters == 1);
+ DCHECK(characters == 1);
__ movzx_b(current_character(), Operand(esi, edi, times_1, cp_offset));
}
} else {
- ASSERT(mode_ == UC16);
+ DCHECK(mode_ == UC16);
if (characters == 2) {
__ mov(current_character(),
Operand(esi, edi, times_1, cp_offset * sizeof(uc16)));
} else {
- ASSERT(characters == 1);
+ DCHECK(characters == 1);
__ movzx_w(current_character(),
Operand(esi, edi, times_1, cp_offset * sizeof(uc16)));
}