Index: src/sh4/regexp-macro-assembler-sh4.h |
diff --git a/src/arm/regexp-macro-assembler-arm.h b/src/sh4/regexp-macro-assembler-sh4.h |
similarity index 91% |
copy from src/arm/regexp-macro-assembler-arm.h |
copy to src/sh4/regexp-macro-assembler-sh4.h |
index c45669ae899f0f709cc4dc3bfa6ab0f71efd57bf..a90ea4c1a256cef5d2d11a9dc43db3e6fbc83c79 100644 |
--- a/src/arm/regexp-macro-assembler-arm.h |
+++ b/src/sh4/regexp-macro-assembler-sh4.h |
@@ -1,4 +1,4 @@ |
-// Copyright 2012 the V8 project authors. All rights reserved. |
+// Copyright 2011-2012 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -25,21 +25,28 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#ifndef V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_ |
-#define V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_ |
+#ifndef V8_SH4_REGEXP_MACRO_ASSEMBLER_SH4_H_ |
+#define V8_SH4_REGEXP_MACRO_ASSEMBLER_SH4_H_ |
-#include "arm/assembler-arm.h" |
-#include "arm/assembler-arm-inl.h" |
+#include "sh4/assembler-sh4.h" |
+#include "sh4/assembler-sh4-inl.h" |
namespace v8 { |
namespace internal { |
-#ifndef V8_INTERPRETED_REGEXP |
-class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler { |
+#ifdef V8_INTERPRETED_REGEXP |
+class RegExpMacroAssemblerSH4: public RegExpMacroAssembler { |
public: |
- RegExpMacroAssemblerARM(Mode mode, int registers_to_save, Zone* zone); |
- virtual ~RegExpMacroAssemblerARM(); |
+ RegExpMacroAssemblerSH4(); |
+ virtual ~RegExpMacroAssemblerSH4(); |
+}; |
+ |
+#else // V8_INTERPRETED_REGEXP |
+class RegExpMacroAssemblerSH4: public NativeRegExpMacroAssembler { |
+ public: |
+ RegExpMacroAssemblerSH4(Mode mode, int registers_to_save, Zone* zone); |
+ virtual ~RegExpMacroAssemblerSH4(); |
virtual int stack_limit_slack(); |
virtual void AdvanceCurrentPosition(int by); |
virtual void AdvanceRegister(int reg, int by); |
@@ -109,7 +116,6 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler { |
virtual void WriteCurrentPositionToRegister(int reg, int cp_offset); |
virtual void ClearRegisters(int reg_from, int reg_to); |
virtual void WriteStackPointerToRegister(int reg); |
- virtual bool CanReadUnaligned(); |
// Called from RegExp if the stack-guard is triggered. |
// If the code object is relocated, the return address is fixed before |
@@ -126,7 +132,7 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler { |
// Register 4..11. |
static const int kStoredRegisters = kFramePointer; |
// Return address (stored from link register, read into pc on return). |
- static const int kReturnAddress = kStoredRegisters + 8 * kPointerSize; |
+ static const int kReturnAddress = kStoredRegisters + 7 * kPointerSize; |
static const int kSecondaryReturnAddress = kReturnAddress + kPointerSize; |
// Stack parameters placed by caller. |
static const int kRegisterOutput = kSecondaryReturnAddress + kPointerSize; |
@@ -151,8 +157,6 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler { |
// Initial size of code buffer. |
static const size_t kRegExpCodeSize = 1024; |
- static const int kBacktrackConstantPoolSize = 4; |
- |
// Load a number of characters at the given offset from the |
// current position, into the current-character register. |
void LoadCurrentCharacterUnchecked(int cp_offset, int character_count); |
@@ -163,10 +167,6 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler { |
// Check whether we are exceeding the stack limit on the backtrack stack. |
void CheckStackLimit(); |
- void EmitBacktrackConstantPool(); |
- int GetBacktrackConstantPoolEntry(); |
- |
- |
// Generate a call to CheckStackGuardState. |
void CallCheckStackGuardState(Register scratch); |
@@ -181,7 +181,7 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler { |
inline Register current_character() { return r7; } |
// Register holding address of the end of the input string. |
- inline Register end_of_input_address() { return r10; } |
+ inline Register end_of_input_address() { return r9; } |
// Register holding the frame address. Local variables, parameters and |
// regexp registers are addressed relative to this. |
@@ -236,11 +236,6 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler { |
// are always 0..num_saved_registers_-1) |
int num_saved_registers_; |
- // Manage a small pre-allocated pool for writing label targets |
- // to for pushing backtrack addresses. |
- int backtrack_constant_pool_offset_; |
- int backtrack_constant_pool_capacity_; |
- |
// Labels used internally. |
Label entry_label_; |
Label start_label_; |
@@ -256,4 +251,4 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler { |
}} // namespace v8::internal |
-#endif // V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_ |
+#endif // V8_SH4_REGEXP_MACRO_ASSEMBLER_SH4_H_ |