| Index: src/ppc/regexp-macro-assembler-ppc.h
|
| diff --git a/src/arm/regexp-macro-assembler-arm.h b/src/ppc/regexp-macro-assembler-ppc.h
|
| similarity index 81%
|
| copy from src/arm/regexp-macro-assembler-arm.h
|
| copy to src/ppc/regexp-macro-assembler-ppc.h
|
| index fef8413411f47f9717d62ddf7f39816d8e86c4f0..83b0621be975f4b2b07c377c439d29d0e714af97 100644
|
| --- a/src/arm/regexp-macro-assembler-arm.h
|
| +++ b/src/ppc/regexp-macro-assembler-ppc.h
|
| @@ -1,23 +1,26 @@
|
| // Copyright 2012 the V8 project authors. All rights reserved.
|
| +//
|
| +// Copyright IBM Corp. 2012, 2013. All rights reserved.
|
| +//
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
|
| -#define V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
|
| +#ifndef V8_PPC_REGEXP_MACRO_ASSEMBLER_PPC_H_
|
| +#define V8_PPC_REGEXP_MACRO_ASSEMBLER_PPC_H_
|
|
|
| -#include "src/arm/assembler-arm.h"
|
| -#include "src/arm/assembler-arm-inl.h"
|
| #include "src/macro-assembler.h"
|
| +#include "src/ppc/assembler-ppc.h"
|
| +#include "src/ppc/assembler-ppc-inl.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
|
|
|
|
| #ifndef V8_INTERPRETED_REGEXP
|
| -class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
|
| +class RegExpMacroAssemblerPPC: public NativeRegExpMacroAssembler {
|
| public:
|
| - RegExpMacroAssemblerARM(Mode mode, int registers_to_save, Zone* zone);
|
| - virtual ~RegExpMacroAssemblerARM();
|
| + RegExpMacroAssemblerPPC(Mode mode, int registers_to_save, Zone* zone);
|
| + virtual ~RegExpMacroAssemblerPPC();
|
| virtual int stack_limit_slack();
|
| virtual void AdvanceCurrentPosition(int by);
|
| virtual void AdvanceRegister(int reg, int by);
|
| @@ -97,21 +100,23 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
|
| static const int kFramePointer = 0;
|
|
|
| // Above the frame pointer - Stored registers and stack passed parameters.
|
| - // Register 4..11.
|
| + // Register 25..31.
|
| 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 kSecondaryReturnAddress = kReturnAddress + kPointerSize;
|
| + static const int kReturnAddress = kStoredRegisters + 7 * kPointerSize;
|
| + static const int kCallerFrame = kReturnAddress + kPointerSize;
|
| // Stack parameters placed by caller.
|
| - static const int kRegisterOutput = kSecondaryReturnAddress + kPointerSize;
|
| - static const int kNumOutputRegisters = kRegisterOutput + kPointerSize;
|
| - static const int kStackHighEnd = kNumOutputRegisters + kPointerSize;
|
| - static const int kDirectCall = kStackHighEnd + kPointerSize;
|
| - static const int kIsolate = kDirectCall + kPointerSize;
|
| + static const int kSecondaryReturnAddress = kCallerFrame +
|
| + kStackFrameExtraParamSlot * kPointerSize;
|
| + static const int kIsolate = kSecondaryReturnAddress + kPointerSize;
|
|
|
| // Below the frame pointer.
|
| // Register parameters stored by setup code.
|
| - static const int kInputEnd = kFramePointer - kPointerSize;
|
| + static const int kDirectCall = kFramePointer - kPointerSize;
|
| + static const int kStackHighEnd = kDirectCall - kPointerSize;
|
| + static const int kNumOutputRegisters = kStackHighEnd - kPointerSize;
|
| + static const int kRegisterOutput = kNumOutputRegisters - kPointerSize;
|
| + static const int kInputEnd = kRegisterOutput - kPointerSize;
|
| static const int kInputStart = kInputEnd - kPointerSize;
|
| static const int kStartIndex = kInputStart - kPointerSize;
|
| static const int kInputString = kStartIndex - kPointerSize;
|
| @@ -125,8 +130,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);
|
| @@ -146,13 +149,13 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
|
|
|
| // Register holding the current input position as negative offset from
|
| // the end of the string.
|
| - inline Register current_input_offset() { return r6; }
|
| + inline Register current_input_offset() { return r27; }
|
|
|
| // The register containing the current character after LoadCurrentCharacter.
|
| - inline Register current_character() { return r7; }
|
| + inline Register current_character() { return r28; }
|
|
|
| // 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 r30; }
|
|
|
| // Register holding the frame address. Local variables, parameters and
|
| // regexp registers are addressed relative to this.
|
| @@ -160,21 +163,21 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
|
|
|
| // The register containing the backtrack stack top. Provides a meaningful
|
| // name to the register.
|
| - inline Register backtrack_stackpointer() { return r8; }
|
| + inline Register backtrack_stackpointer() { return r29; }
|
|
|
| // Register holding pointer to the current code object.
|
| - inline Register code_pointer() { return r5; }
|
| + inline Register code_pointer() { return r26; }
|
|
|
| // Byte size of chars in the string to match (decided by the Mode argument)
|
| 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.
|
| - void BranchOrBacktrack(Condition condition, Label* to);
|
| + void BranchOrBacktrack(Condition condition, Label* to, CRegister cr = cr7);
|
|
|
| // Call and return internally in the generated code in a way that
|
| // is GC-safe (i.e., doesn't leave absolute code addresses on the stack)
|
| - inline void SafeCall(Label* to, Condition cond = al);
|
| + inline void SafeCall(Label* to, Condition cond = al, CRegister cr = cr7);
|
| inline void SafeReturn();
|
| inline void SafeCallTarget(Label* name);
|
|
|
| @@ -208,11 +211,22 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
|
| Label exit_label_;
|
| Label check_preempt_label_;
|
| Label stack_overflow_label_;
|
| + Label internal_failure_label_;
|
| };
|
|
|
| +// Set of non-volatile registers saved/restored by generated regexp code.
|
| +const RegList kRegExpCalleeSaved =
|
| + 1 << 25 |
|
| + 1 << 26 |
|
| + 1 << 27 |
|
| + 1 << 28 |
|
| + 1 << 29 |
|
| + 1 << 30 |
|
| + 1 << 31;
|
| +
|
| #endif // V8_INTERPRETED_REGEXP
|
|
|
|
|
| }} // namespace v8::internal
|
|
|
| -#endif // V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
|
| +#endif // V8_PPC_REGEXP_MACRO_ASSEMBLER_PPC_H_
|
|
|