OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "code.h" | 34 #include "code.h" |
35 #include "x64/macro-assembler-x64.h" | 35 #include "x64/macro-assembler-x64.h" |
36 | 36 |
37 namespace v8 { | 37 namespace v8 { |
38 namespace internal { | 38 namespace internal { |
39 | 39 |
40 #ifndef V8_INTERPRETED_REGEXP | 40 #ifndef V8_INTERPRETED_REGEXP |
41 | 41 |
42 class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler { | 42 class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler { |
43 public: | 43 public: |
44 RegExpMacroAssemblerX64(Mode mode, int registers_to_save); | 44 RegExpMacroAssemblerX64(Mode mode, int registers_to_save, Zone* zone); |
45 virtual ~RegExpMacroAssemblerX64(); | 45 virtual ~RegExpMacroAssemblerX64(); |
46 virtual int stack_limit_slack(); | 46 virtual int stack_limit_slack(); |
47 virtual void AdvanceCurrentPosition(int by); | 47 virtual void AdvanceCurrentPosition(int by); |
48 virtual void AdvanceRegister(int reg, int by); | 48 virtual void AdvanceRegister(int reg, int by); |
49 virtual void Backtrack(); | 49 virtual void Backtrack(); |
50 virtual void Bind(Label* label); | 50 virtual void Bind(Label* label); |
51 virtual void CheckAtStart(Label* on_at_start); | 51 virtual void CheckAtStart(Label* on_at_start); |
52 virtual void CheckCharacter(uint32_t c, Label* on_equal); | 52 virtual void CheckCharacter(uint32_t c, Label* on_equal); |
53 virtual void CheckCharacterAfterAnd(uint32_t c, | 53 virtual void CheckCharacterAfterAnd(uint32_t c, |
54 uint32_t mask, | 54 uint32_t mask, |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 inline Register code_object_pointer() { return r8; } | 234 inline Register code_object_pointer() { return r8; } |
235 | 235 |
236 // Byte size of chars in the string to match (decided by the Mode argument) | 236 // Byte size of chars in the string to match (decided by the Mode argument) |
237 inline int char_size() { return static_cast<int>(mode_); } | 237 inline int char_size() { return static_cast<int>(mode_); } |
238 | 238 |
239 // Equivalent to a conditional branch to the label, unless the label | 239 // Equivalent to a conditional branch to the label, unless the label |
240 // is NULL, in which case it is a conditional Backtrack. | 240 // is NULL, in which case it is a conditional Backtrack. |
241 void BranchOrBacktrack(Condition condition, Label* to); | 241 void BranchOrBacktrack(Condition condition, Label* to); |
242 | 242 |
243 void MarkPositionForCodeRelativeFixup() { | 243 void MarkPositionForCodeRelativeFixup() { |
244 code_relative_fixup_positions_.Add(masm_.pc_offset()); | 244 code_relative_fixup_positions_.Add(masm_.pc_offset(), zone()); |
245 } | 245 } |
246 | 246 |
247 void FixupCodeRelativePositions(); | 247 void FixupCodeRelativePositions(); |
248 | 248 |
249 // Call and return internally in the generated code in a way that | 249 // Call and return internally in the generated code in a way that |
250 // is GC-safe (i.e., doesn't leave absolute code addresses on the stack) | 250 // is GC-safe (i.e., doesn't leave absolute code addresses on the stack) |
251 inline void SafeCall(Label* to); | 251 inline void SafeCall(Label* to); |
252 inline void SafeCallTarget(Label* label); | 252 inline void SafeCallTarget(Label* label); |
253 inline void SafeReturn(); | 253 inline void SafeReturn(); |
254 | 254 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 Label exit_label_; | 296 Label exit_label_; |
297 Label check_preempt_label_; | 297 Label check_preempt_label_; |
298 Label stack_overflow_label_; | 298 Label stack_overflow_label_; |
299 }; | 299 }; |
300 | 300 |
301 #endif // V8_INTERPRETED_REGEXP | 301 #endif // V8_INTERPRETED_REGEXP |
302 | 302 |
303 }} // namespace v8::internal | 303 }} // namespace v8::internal |
304 | 304 |
305 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ | 305 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |