Index: src/x87/regexp-macro-assembler-x87.cc |
diff --git a/src/ia32/regexp-macro-assembler-ia32.cc b/src/x87/regexp-macro-assembler-x87.cc |
similarity index 91% |
copy from src/ia32/regexp-macro-assembler-ia32.cc |
copy to src/x87/regexp-macro-assembler-x87.cc |
index 4d1f23512ece43756d78154e888c726674ae94f5..59666bf850cb1e7aba0d48b795d7341dba252edb 100644 |
--- a/src/ia32/regexp-macro-assembler-ia32.cc |
+++ b/src/x87/regexp-macro-assembler-x87.cc |
@@ -4,7 +4,7 @@ |
#include "v8.h" |
-#if V8_TARGET_ARCH_IA32 |
+#if V8_TARGET_ARCH_X87 |
#include "cpu-profiler.h" |
#include "unicode.h" |
@@ -12,7 +12,7 @@ |
#include "regexp-stack.h" |
#include "macro-assembler.h" |
#include "regexp-macro-assembler.h" |
-#include "ia32/regexp-macro-assembler-ia32.h" |
+#include "x87/regexp-macro-assembler-x87.h" |
namespace v8 { |
namespace internal { |
@@ -77,7 +77,7 @@ namespace internal { |
#define __ ACCESS_MASM(masm_) |
-RegExpMacroAssemblerIA32::RegExpMacroAssemblerIA32( |
+RegExpMacroAssemblerX87::RegExpMacroAssemblerX87( |
Mode mode, |
int registers_to_save, |
Zone* zone) |
@@ -97,7 +97,7 @@ RegExpMacroAssemblerIA32::RegExpMacroAssemblerIA32( |
} |
-RegExpMacroAssemblerIA32::~RegExpMacroAssemblerIA32() { |
+RegExpMacroAssemblerX87::~RegExpMacroAssemblerX87() { |
delete masm_; |
// Unuse labels in case we throw away the assembler without calling GetCode. |
entry_label_.Unuse(); |
@@ -110,19 +110,19 @@ RegExpMacroAssemblerIA32::~RegExpMacroAssemblerIA32() { |
} |
-int RegExpMacroAssemblerIA32::stack_limit_slack() { |
+int RegExpMacroAssemblerX87::stack_limit_slack() { |
return RegExpStack::kStackLimitSlack; |
} |
-void RegExpMacroAssemblerIA32::AdvanceCurrentPosition(int by) { |
+void RegExpMacroAssemblerX87::AdvanceCurrentPosition(int by) { |
if (by != 0) { |
__ add(edi, Immediate(by * char_size())); |
} |
} |
-void RegExpMacroAssemblerIA32::AdvanceRegister(int reg, int by) { |
+void RegExpMacroAssemblerX87::AdvanceRegister(int reg, int by) { |
ASSERT(reg >= 0); |
ASSERT(reg < num_registers_); |
if (by != 0) { |
@@ -131,7 +131,7 @@ void RegExpMacroAssemblerIA32::AdvanceRegister(int reg, int by) { |
} |
-void RegExpMacroAssemblerIA32::Backtrack() { |
+void RegExpMacroAssemblerX87::Backtrack() { |
CheckPreemption(); |
// Pop Code* offset from backtrack stack, add Code* and jump to location. |
Pop(ebx); |
@@ -140,24 +140,24 @@ void RegExpMacroAssemblerIA32::Backtrack() { |
} |
-void RegExpMacroAssemblerIA32::Bind(Label* label) { |
+void RegExpMacroAssemblerX87::Bind(Label* label) { |
__ bind(label); |
} |
-void RegExpMacroAssemblerIA32::CheckCharacter(uint32_t c, Label* on_equal) { |
+void RegExpMacroAssemblerX87::CheckCharacter(uint32_t c, Label* on_equal) { |
__ cmp(current_character(), c); |
BranchOrBacktrack(equal, on_equal); |
} |
-void RegExpMacroAssemblerIA32::CheckCharacterGT(uc16 limit, Label* on_greater) { |
+void RegExpMacroAssemblerX87::CheckCharacterGT(uc16 limit, Label* on_greater) { |
__ cmp(current_character(), limit); |
BranchOrBacktrack(greater, on_greater); |
} |
-void RegExpMacroAssemblerIA32::CheckAtStart(Label* on_at_start) { |
+void RegExpMacroAssemblerX87::CheckAtStart(Label* on_at_start) { |
Label not_at_start; |
// Did we start the match at the start of the string at all? |
__ cmp(Operand(ebp, kStartIndex), Immediate(0)); |
@@ -170,7 +170,7 @@ void RegExpMacroAssemblerIA32::CheckAtStart(Label* on_at_start) { |
} |
-void RegExpMacroAssemblerIA32::CheckNotAtStart(Label* on_not_at_start) { |
+void RegExpMacroAssemblerX87::CheckNotAtStart(Label* on_not_at_start) { |
// Did we start the match at the start of the string at all? |
__ cmp(Operand(ebp, kStartIndex), Immediate(0)); |
BranchOrBacktrack(not_equal, on_not_at_start); |
@@ -181,13 +181,13 @@ void RegExpMacroAssemblerIA32::CheckNotAtStart(Label* on_not_at_start) { |
} |
-void RegExpMacroAssemblerIA32::CheckCharacterLT(uc16 limit, Label* on_less) { |
+void RegExpMacroAssemblerX87::CheckCharacterLT(uc16 limit, Label* on_less) { |
__ cmp(current_character(), limit); |
BranchOrBacktrack(less, on_less); |
} |
-void RegExpMacroAssemblerIA32::CheckGreedyLoop(Label* on_equal) { |
+void RegExpMacroAssemblerX87::CheckGreedyLoop(Label* on_equal) { |
Label fallthrough; |
__ cmp(edi, Operand(backtrack_stackpointer(), 0)); |
__ j(not_equal, &fallthrough); |
@@ -197,7 +197,7 @@ void RegExpMacroAssemblerIA32::CheckGreedyLoop(Label* on_equal) { |
} |
-void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase( |
+void RegExpMacroAssemblerX87::CheckNotBackReferenceIgnoreCase( |
int start_reg, |
Label* on_no_match) { |
Label fallthrough; |
@@ -334,7 +334,7 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase( |
} |
-void RegExpMacroAssemblerIA32::CheckNotBackReference( |
+void RegExpMacroAssemblerX87::CheckNotBackReference( |
int start_reg, |
Label* on_no_match) { |
Label fallthrough; |
@@ -398,14 +398,14 @@ void RegExpMacroAssemblerIA32::CheckNotBackReference( |
} |
-void RegExpMacroAssemblerIA32::CheckNotCharacter(uint32_t c, |
+void RegExpMacroAssemblerX87::CheckNotCharacter(uint32_t c, |
Label* on_not_equal) { |
__ cmp(current_character(), c); |
BranchOrBacktrack(not_equal, on_not_equal); |
} |
-void RegExpMacroAssemblerIA32::CheckCharacterAfterAnd(uint32_t c, |
+void RegExpMacroAssemblerX87::CheckCharacterAfterAnd(uint32_t c, |
uint32_t mask, |
Label* on_equal) { |
if (c == 0) { |
@@ -419,7 +419,7 @@ void RegExpMacroAssemblerIA32::CheckCharacterAfterAnd(uint32_t c, |
} |
-void RegExpMacroAssemblerIA32::CheckNotCharacterAfterAnd(uint32_t c, |
+void RegExpMacroAssemblerX87::CheckNotCharacterAfterAnd(uint32_t c, |
uint32_t mask, |
Label* on_not_equal) { |
if (c == 0) { |
@@ -433,7 +433,7 @@ void RegExpMacroAssemblerIA32::CheckNotCharacterAfterAnd(uint32_t c, |
} |
-void RegExpMacroAssemblerIA32::CheckNotCharacterAfterMinusAnd( |
+void RegExpMacroAssemblerX87::CheckNotCharacterAfterMinusAnd( |
uc16 c, |
uc16 minus, |
uc16 mask, |
@@ -450,7 +450,7 @@ void RegExpMacroAssemblerIA32::CheckNotCharacterAfterMinusAnd( |
} |
-void RegExpMacroAssemblerIA32::CheckCharacterInRange( |
+void RegExpMacroAssemblerX87::CheckCharacterInRange( |
uc16 from, |
uc16 to, |
Label* on_in_range) { |
@@ -460,7 +460,7 @@ void RegExpMacroAssemblerIA32::CheckCharacterInRange( |
} |
-void RegExpMacroAssemblerIA32::CheckCharacterNotInRange( |
+void RegExpMacroAssemblerX87::CheckCharacterNotInRange( |
uc16 from, |
uc16 to, |
Label* on_not_in_range) { |
@@ -470,7 +470,7 @@ void RegExpMacroAssemblerIA32::CheckCharacterNotInRange( |
} |
-void RegExpMacroAssemblerIA32::CheckBitInTable( |
+void RegExpMacroAssemblerX87::CheckBitInTable( |
Handle<ByteArray> table, |
Label* on_bit_set) { |
__ mov(eax, Immediate(table)); |
@@ -485,7 +485,7 @@ void RegExpMacroAssemblerIA32::CheckBitInTable( |
} |
-bool RegExpMacroAssemblerIA32::CheckSpecialCharacterClass(uc16 type, |
+bool RegExpMacroAssemblerX87::CheckSpecialCharacterClass(uc16 type, |
Label* on_no_match) { |
// Range checks (c in min..max) are generally implemented by an unsigned |
// (c - min) <= (max - min) check |
@@ -606,7 +606,7 @@ bool RegExpMacroAssemblerIA32::CheckSpecialCharacterClass(uc16 type, |
} |
-void RegExpMacroAssemblerIA32::Fail() { |
+void RegExpMacroAssemblerX87::Fail() { |
STATIC_ASSERT(FAILURE == 0); // Return value for failure is zero. |
if (!global()) { |
__ Move(eax, Immediate(FAILURE)); |
@@ -615,7 +615,7 @@ void RegExpMacroAssemblerIA32::Fail() { |
} |
-Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) { |
+Handle<HeapObject> RegExpMacroAssemblerX87::GetCode(Handle<String> source) { |
Label return_eax; |
// Finalize code - write the entry point code now we know how many |
// registers we need. |
@@ -908,12 +908,12 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) { |
} |
-void RegExpMacroAssemblerIA32::GoTo(Label* to) { |
+void RegExpMacroAssemblerX87::GoTo(Label* to) { |
BranchOrBacktrack(no_condition, to); |
} |
-void RegExpMacroAssemblerIA32::IfRegisterGE(int reg, |
+void RegExpMacroAssemblerX87::IfRegisterGE(int reg, |
int comparand, |
Label* if_ge) { |
__ cmp(register_location(reg), Immediate(comparand)); |
@@ -921,7 +921,7 @@ void RegExpMacroAssemblerIA32::IfRegisterGE(int reg, |
} |
-void RegExpMacroAssemblerIA32::IfRegisterLT(int reg, |
+void RegExpMacroAssemblerX87::IfRegisterLT(int reg, |
int comparand, |
Label* if_lt) { |
__ cmp(register_location(reg), Immediate(comparand)); |
@@ -929,7 +929,7 @@ void RegExpMacroAssemblerIA32::IfRegisterLT(int reg, |
} |
-void RegExpMacroAssemblerIA32::IfRegisterEqPos(int reg, |
+void RegExpMacroAssemblerX87::IfRegisterEqPos(int reg, |
Label* if_eq) { |
__ cmp(edi, register_location(reg)); |
BranchOrBacktrack(equal, if_eq); |
@@ -937,12 +937,12 @@ void RegExpMacroAssemblerIA32::IfRegisterEqPos(int reg, |
RegExpMacroAssembler::IrregexpImplementation |
- RegExpMacroAssemblerIA32::Implementation() { |
- return kIA32Implementation; |
+ RegExpMacroAssemblerX87::Implementation() { |
+ return kX87Implementation; |
} |
-void RegExpMacroAssemblerIA32::LoadCurrentCharacter(int cp_offset, |
+void RegExpMacroAssemblerX87::LoadCurrentCharacter(int cp_offset, |
Label* on_end_of_input, |
bool check_bounds, |
int characters) { |
@@ -955,29 +955,29 @@ void RegExpMacroAssemblerIA32::LoadCurrentCharacter(int cp_offset, |
} |
-void RegExpMacroAssemblerIA32::PopCurrentPosition() { |
+void RegExpMacroAssemblerX87::PopCurrentPosition() { |
Pop(edi); |
} |
-void RegExpMacroAssemblerIA32::PopRegister(int register_index) { |
+void RegExpMacroAssemblerX87::PopRegister(int register_index) { |
Pop(eax); |
__ mov(register_location(register_index), eax); |
} |
-void RegExpMacroAssemblerIA32::PushBacktrack(Label* label) { |
+void RegExpMacroAssemblerX87::PushBacktrack(Label* label) { |
Push(Immediate::CodeRelativeOffset(label)); |
CheckStackLimit(); |
} |
-void RegExpMacroAssemblerIA32::PushCurrentPosition() { |
+void RegExpMacroAssemblerX87::PushCurrentPosition() { |
Push(edi); |
} |
-void RegExpMacroAssemblerIA32::PushRegister(int register_index, |
+void RegExpMacroAssemblerX87::PushRegister(int register_index, |
StackCheckFlag check_stack_limit) { |
__ mov(eax, register_location(register_index)); |
Push(eax); |
@@ -985,17 +985,17 @@ void RegExpMacroAssemblerIA32::PushRegister(int register_index, |
} |
-void RegExpMacroAssemblerIA32::ReadCurrentPositionFromRegister(int reg) { |
+void RegExpMacroAssemblerX87::ReadCurrentPositionFromRegister(int reg) { |
__ mov(edi, register_location(reg)); |
} |
-void RegExpMacroAssemblerIA32::ReadStackPointerFromRegister(int reg) { |
+void RegExpMacroAssemblerX87::ReadStackPointerFromRegister(int reg) { |
__ mov(backtrack_stackpointer(), register_location(reg)); |
__ add(backtrack_stackpointer(), Operand(ebp, kStackHighEnd)); |
} |
-void RegExpMacroAssemblerIA32::SetCurrentPositionFromEnd(int by) { |
+void RegExpMacroAssemblerX87::SetCurrentPositionFromEnd(int by) { |
Label after_position; |
__ cmp(edi, -by * char_size()); |
__ j(greater_equal, &after_position, Label::kNear); |
@@ -1008,19 +1008,19 @@ void RegExpMacroAssemblerIA32::SetCurrentPositionFromEnd(int by) { |
} |
-void RegExpMacroAssemblerIA32::SetRegister(int register_index, int to) { |
+void RegExpMacroAssemblerX87::SetRegister(int register_index, int to) { |
ASSERT(register_index >= num_saved_registers_); // Reserved for positions! |
__ mov(register_location(register_index), Immediate(to)); |
} |
-bool RegExpMacroAssemblerIA32::Succeed() { |
+bool RegExpMacroAssemblerX87::Succeed() { |
__ jmp(&success_label_); |
return global(); |
} |
-void RegExpMacroAssemblerIA32::WriteCurrentPositionToRegister(int reg, |
+void RegExpMacroAssemblerX87::WriteCurrentPositionToRegister(int reg, |
int cp_offset) { |
if (cp_offset == 0) { |
__ mov(register_location(reg), edi); |
@@ -1031,7 +1031,7 @@ void RegExpMacroAssemblerIA32::WriteCurrentPositionToRegister(int reg, |
} |
-void RegExpMacroAssemblerIA32::ClearRegisters(int reg_from, int reg_to) { |
+void RegExpMacroAssemblerX87::ClearRegisters(int reg_from, int reg_to) { |
ASSERT(reg_from <= reg_to); |
__ mov(eax, Operand(ebp, kInputStartMinusOne)); |
for (int reg = reg_from; reg <= reg_to; reg++) { |
@@ -1040,7 +1040,7 @@ void RegExpMacroAssemblerIA32::ClearRegisters(int reg_from, int reg_to) { |
} |
-void RegExpMacroAssemblerIA32::WriteStackPointerToRegister(int reg) { |
+void RegExpMacroAssemblerX87::WriteStackPointerToRegister(int reg) { |
__ mov(eax, backtrack_stackpointer()); |
__ sub(eax, Operand(ebp, kStackHighEnd)); |
__ mov(register_location(reg), eax); |
@@ -1049,7 +1049,7 @@ void RegExpMacroAssemblerIA32::WriteStackPointerToRegister(int reg) { |
// Private methods: |
-void RegExpMacroAssemblerIA32::CallCheckStackGuardState(Register scratch) { |
+void RegExpMacroAssemblerX87::CallCheckStackGuardState(Register scratch) { |
static const int num_arguments = 3; |
__ PrepareCallCFunction(num_arguments, scratch); |
// RegExp code frame pointer. |
@@ -1072,7 +1072,7 @@ static T& frame_entry(Address re_frame, int frame_offset) { |
} |
-int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address, |
+int RegExpMacroAssemblerX87::CheckStackGuardState(Address* return_address, |
Code* re_code, |
Address re_frame) { |
Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate); |
@@ -1170,7 +1170,7 @@ int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address, |
} |
-Operand RegExpMacroAssemblerIA32::register_location(int register_index) { |
+Operand RegExpMacroAssemblerX87::register_location(int register_index) { |
ASSERT(register_index < (1<<30)); |
if (num_registers_ <= register_index) { |
num_registers_ = register_index + 1; |
@@ -1179,14 +1179,14 @@ Operand RegExpMacroAssemblerIA32::register_location(int register_index) { |
} |
-void RegExpMacroAssemblerIA32::CheckPosition(int cp_offset, |
+void RegExpMacroAssemblerX87::CheckPosition(int cp_offset, |
Label* on_outside_input) { |
__ cmp(edi, -cp_offset * char_size()); |
BranchOrBacktrack(greater_equal, on_outside_input); |
} |
-void RegExpMacroAssemblerIA32::BranchOrBacktrack(Condition condition, |
+void RegExpMacroAssemblerX87::BranchOrBacktrack(Condition condition, |
Label* to) { |
if (condition < 0) { // No condition |
if (to == NULL) { |
@@ -1204,7 +1204,7 @@ void RegExpMacroAssemblerIA32::BranchOrBacktrack(Condition condition, |
} |
-void RegExpMacroAssemblerIA32::SafeCall(Label* to) { |
+void RegExpMacroAssemblerX87::SafeCall(Label* to) { |
Label return_to; |
__ push(Immediate::CodeRelativeOffset(&return_to)); |
__ jmp(to); |
@@ -1212,19 +1212,19 @@ void RegExpMacroAssemblerIA32::SafeCall(Label* to) { |
} |
-void RegExpMacroAssemblerIA32::SafeReturn() { |
+void RegExpMacroAssemblerX87::SafeReturn() { |
__ pop(ebx); |
__ add(ebx, Immediate(masm_->CodeObject())); |
__ jmp(ebx); |
} |
-void RegExpMacroAssemblerIA32::SafeCallTarget(Label* name) { |
+void RegExpMacroAssemblerX87::SafeCallTarget(Label* name) { |
__ bind(name); |
} |
-void RegExpMacroAssemblerIA32::Push(Register source) { |
+void RegExpMacroAssemblerX87::Push(Register source) { |
ASSERT(!source.is(backtrack_stackpointer())); |
// Notice: This updates flags, unlike normal Push. |
__ sub(backtrack_stackpointer(), Immediate(kPointerSize)); |
@@ -1232,14 +1232,14 @@ void RegExpMacroAssemblerIA32::Push(Register source) { |
} |
-void RegExpMacroAssemblerIA32::Push(Immediate value) { |
+void RegExpMacroAssemblerX87::Push(Immediate value) { |
// Notice: This updates flags, unlike normal Push. |
__ sub(backtrack_stackpointer(), Immediate(kPointerSize)); |
__ mov(Operand(backtrack_stackpointer(), 0), value); |
} |
-void RegExpMacroAssemblerIA32::Pop(Register target) { |
+void RegExpMacroAssemblerX87::Pop(Register target) { |
ASSERT(!target.is(backtrack_stackpointer())); |
__ mov(target, Operand(backtrack_stackpointer(), 0)); |
// Notice: This updates flags, unlike normal Pop. |
@@ -1247,7 +1247,7 @@ void RegExpMacroAssemblerIA32::Pop(Register target) { |
} |
-void RegExpMacroAssemblerIA32::CheckPreemption() { |
+void RegExpMacroAssemblerX87::CheckPreemption() { |
// Check for preemption. |
Label no_preempt; |
ExternalReference stack_limit = |
@@ -1261,7 +1261,7 @@ void RegExpMacroAssemblerIA32::CheckPreemption() { |
} |
-void RegExpMacroAssemblerIA32::CheckStackLimit() { |
+void RegExpMacroAssemblerX87::CheckStackLimit() { |
Label no_stack_overflow; |
ExternalReference stack_limit = |
ExternalReference::address_of_regexp_stack_limit(isolate()); |
@@ -1274,7 +1274,7 @@ void RegExpMacroAssemblerIA32::CheckStackLimit() { |
} |
-void RegExpMacroAssemblerIA32::LoadCurrentCharacterUnchecked(int cp_offset, |
+void RegExpMacroAssemblerX87::LoadCurrentCharacterUnchecked(int cp_offset, |
int characters) { |
if (mode_ == ASCII) { |
if (characters == 4) { |
@@ -1305,4 +1305,4 @@ void RegExpMacroAssemblerIA32::LoadCurrentCharacterUnchecked(int cp_offset, |
}} // namespace v8::internal |
-#endif // V8_TARGET_ARCH_IA32 |
+#endif // V8_TARGET_ARCH_X87 |