Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: src/ppc/regexp-macro-assembler-ppc.h

Issue 422063005: Contribution of PowerPC port. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: re-upload - catch up to 8/19 level Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 74%
copy from src/arm/regexp-macro-assembler-arm.h
copy to src/ppc/regexp-macro-assembler-ppc.h
index fef8413411f47f9717d62ddf7f39816d8e86c4f0..82a4135bc33c62b23fecfe6c57a6779d577e5713 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);
@@ -25,8 +28,7 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
virtual void Bind(Label* label);
virtual void CheckAtStart(Label* on_at_start);
virtual void CheckCharacter(unsigned c, Label* on_equal);
- virtual void CheckCharacterAfterAnd(unsigned c,
- unsigned mask,
+ virtual void CheckCharacterAfterAnd(unsigned c, unsigned mask,
Label* on_equal);
virtual void CheckCharacterGT(uc16 limit, Label* on_greater);
virtual void CheckCharacterLT(uc16 limit, Label* on_less);
@@ -38,26 +40,19 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
virtual void CheckNotBackReferenceIgnoreCase(int start_reg,
Label* on_no_match);
virtual void CheckNotCharacter(unsigned c, Label* on_not_equal);
- virtual void CheckNotCharacterAfterAnd(unsigned c,
- unsigned mask,
+ virtual void CheckNotCharacterAfterAnd(unsigned c, unsigned mask,
Label* on_not_equal);
- virtual void CheckNotCharacterAfterMinusAnd(uc16 c,
- uc16 minus,
- uc16 mask,
+ virtual void CheckNotCharacterAfterMinusAnd(uc16 c, uc16 minus, uc16 mask,
Label* on_not_equal);
- virtual void CheckCharacterInRange(uc16 from,
- uc16 to,
- Label* on_in_range);
- virtual void CheckCharacterNotInRange(uc16 from,
- uc16 to,
+ virtual void CheckCharacterInRange(uc16 from, uc16 to, Label* on_in_range);
+ virtual void CheckCharacterNotInRange(uc16 from, uc16 to,
Label* on_not_in_range);
virtual void CheckBitInTable(Handle<ByteArray> table, Label* on_bit_set);
// Checks whether the given offset from the current position is before
// the end of the string.
virtual void CheckPosition(int cp_offset, Label* on_outside_input);
- virtual bool CheckSpecialCharacterClass(uc16 type,
- Label* on_no_match);
+ virtual bool CheckSpecialCharacterClass(uc16 type, Label* on_no_match);
virtual void Fail();
virtual Handle<HeapObject> GetCode(Handle<String> source);
virtual void GoTo(Label* label);
@@ -65,8 +60,7 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
virtual void IfRegisterLT(int reg, int comparand, Label* if_lt);
virtual void IfRegisterEqPos(int reg, Label* if_eq);
virtual IrregexpImplementation Implementation();
- virtual void LoadCurrentCharacter(int cp_offset,
- Label* on_end_of_input,
+ virtual void LoadCurrentCharacter(int cp_offset, Label* on_end_of_input,
bool check_bounds = true,
int characters = 1);
virtual void PopCurrentPosition();
@@ -88,8 +82,7 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
// Called from RegExp if the stack-guard is triggered.
// If the code object is relocated, the return address is fixed before
// returning.
- static int CheckStackGuardState(Address* return_address,
- Code* re_code,
+ static int CheckStackGuardState(Address* return_address, Code* re_code,
Address re_frame);
private:
@@ -97,21 +90,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 +120,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 +139,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 +153,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 +201,15 @@ class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
Label exit_label_;
Label check_preempt_label_;
Label stack_overflow_label_;
+ Label internal_failure_label_;
};
-#endif // V8_INTERPRETED_REGEXP
-
+// 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;
-}} // namespace v8::internal
+#endif // V8_INTERPRETED_REGEXP
+}
+} // namespace v8::internal
-#endif // V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
+#endif // V8_PPC_REGEXP_MACRO_ASSEMBLER_PPC_H_

Powered by Google App Engine
This is Rietveld 408576698