~ubuntu-branches/ubuntu/vivid/nodejs/vivid

« back to all changes in this revision

Viewing changes to deps/v8/src/x64/regexp-macro-assembler-x64.h

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-08-14 00:16:46 UTC
  • mfrom: (7.1.40 sid)
  • Revision ID: package-import@ubuntu.com-20130814001646-bzlysfh8sd6mukbo
Tags: 0.10.15~dfsg1-4
* Update 2005 patch, adding a handful of tests that can fail on
  slow platforms.
* Add 1004 patch to fix test failures when writing NaN to buffer
  on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2010 the V8 project authors. All rights reserved.
 
1
// Copyright 2012 the V8 project authors. All rights reserved.
2
2
// Redistribution and use in source and binary forms, with or without
3
3
// modification, are permitted provided that the following conditions are
4
4
// met:
41
41
 
42
42
class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
43
43
 public:
44
 
  RegExpMacroAssemblerX64(Mode mode, int registers_to_save);
 
44
  RegExpMacroAssemblerX64(Mode mode, int registers_to_save, Zone* zone);
45
45
  virtual ~RegExpMacroAssemblerX64();
46
46
  virtual int stack_limit_slack();
47
47
  virtual void AdvanceCurrentPosition(int by);
66
66
  virtual void CheckNotBackReference(int start_reg, Label* on_no_match);
67
67
  virtual void CheckNotBackReferenceIgnoreCase(int start_reg,
68
68
                                               Label* on_no_match);
69
 
  virtual void CheckNotRegistersEqual(int reg1, int reg2, Label* on_not_equal);
70
69
  virtual void CheckNotCharacter(uint32_t c, Label* on_not_equal);
71
70
  virtual void CheckNotCharacterAfterAnd(uint32_t c,
72
71
                                         uint32_t mask,
75
74
                                              uc16 minus,
76
75
                                              uc16 mask,
77
76
                                              Label* on_not_equal);
 
77
  virtual void CheckCharacterInRange(uc16 from,
 
78
                                     uc16 to,
 
79
                                     Label* on_in_range);
 
80
  virtual void CheckCharacterNotInRange(uc16 from,
 
81
                                        uc16 to,
 
82
                                        Label* on_not_in_range);
 
83
  virtual void CheckBitInTable(Handle<ByteArray> table, Label* on_bit_set);
 
84
 
78
85
  // Checks whether the given offset from the current position is before
79
86
  // the end of the string.
80
87
  virtual void CheckPosition(int cp_offset, Label* on_outside_input);
101
108
  virtual void ReadStackPointerFromRegister(int reg);
102
109
  virtual void SetCurrentPositionFromEnd(int by);
103
110
  virtual void SetRegister(int register_index, int to);
104
 
  virtual void Succeed();
 
111
  virtual bool Succeed();
105
112
  virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
106
113
  virtual void ClearRegisters(int reg_from, int reg_to);
107
114
  virtual void WriteStackPointerToRegister(int reg);
146
153
  static const int kInputStart = kStartIndex + kPointerSize;
147
154
  static const int kInputEnd = kInputStart + kPointerSize;
148
155
  static const int kRegisterOutput = kInputEnd + kPointerSize;
149
 
  static const int kStackHighEnd = kRegisterOutput + kPointerSize;
 
156
  // For the case of global regular expression, we have room to store at least
 
157
  // one set of capture results.  For the case of non-global regexp, we ignore
 
158
  // this value. NumOutputRegisters is passed as 32-bit value.  The upper
 
159
  // 32 bit of this 64-bit stack slot may contain garbage.
 
160
  static const int kNumOutputRegisters = kRegisterOutput + kPointerSize;
 
161
  static const int kStackHighEnd = kNumOutputRegisters + kPointerSize;
150
162
  // DirectCall is passed as 32 bit int (values 0 or 1).
151
163
  static const int kDirectCall = kStackHighEnd + kPointerSize;
152
164
  static const int kIsolate = kDirectCall + kPointerSize;
159
171
  static const int kInputStart = kStartIndex - kPointerSize;
160
172
  static const int kInputEnd = kInputStart - kPointerSize;
161
173
  static const int kRegisterOutput = kInputEnd - kPointerSize;
162
 
  static const int kStackHighEnd = kRegisterOutput - kPointerSize;
163
 
  static const int kDirectCall = kFrameAlign;
 
174
  // For the case of global regular expression, we have room to store at least
 
175
  // one set of capture results.  For the case of non-global regexp, we ignore
 
176
  // this value.
 
177
  static const int kNumOutputRegisters = kRegisterOutput - kPointerSize;
 
178
  static const int kStackHighEnd = kFrameAlign;
 
179
  static const int kDirectCall = kStackHighEnd + kPointerSize;
164
180
  static const int kIsolate = kDirectCall + kPointerSize;
165
181
#endif
166
182
 
175
191
  // AMD64 Calling Convention has only one callee-save register that
176
192
  // we use. We push this after the frame pointer (and after the
177
193
  // parameters).
178
 
  static const int kBackup_rbx = kStackHighEnd - kPointerSize;
 
194
  static const int kBackup_rbx = kNumOutputRegisters - kPointerSize;
179
195
  static const int kLastCalleeSaveRegister = kBackup_rbx;
180
196
#endif
181
197
 
 
198
  static const int kSuccessfulCaptures = kLastCalleeSaveRegister - kPointerSize;
182
199
  // When adding local variables remember to push space for them in
183
200
  // the frame in GetCode.
184
 
  static const int kInputStartMinusOne =
185
 
      kLastCalleeSaveRegister - kPointerSize;
 
201
  static const int kInputStartMinusOne = kSuccessfulCaptures - kPointerSize;
186
202
 
187
203
  // First register address. Following registers are below it on the stack.
188
204
  static const int kRegisterZero = kInputStartMinusOne - kPointerSize;
224
240
  void BranchOrBacktrack(Condition condition, Label* to);
225
241
 
226
242
  void MarkPositionForCodeRelativeFixup() {
227
 
    code_relative_fixup_positions_.Add(masm_.pc_offset());
 
243
    code_relative_fixup_positions_.Add(masm_.pc_offset(), zone());
228
244
  }
229
245
 
230
246
  void FixupCodeRelativePositions();