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

Side by Side Diff: src/regexp-macro-assembler-irregexp.h

Issue 17416: * Move irregexp backtrack stack to external memory area, instead of the system stack. (Closed)
Patch Set: Added explicit stack check requests to push operations. Created 11 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 30 matching lines...) Expand all
41 // If the provided buffer is NULL, the assembler allocates and grows its own 41 // If the provided buffer is NULL, the assembler allocates and grows its own
42 // buffer, and buffer_size determines the initial buffer size. The buffer is 42 // buffer, and buffer_size determines the initial buffer size. The buffer is
43 // owned by the assembler and deallocated upon destruction of the assembler. 43 // owned by the assembler and deallocated upon destruction of the assembler.
44 // 44 //
45 // If the provided buffer is not NULL, the assembler uses the provided buffer 45 // If the provided buffer is not NULL, the assembler uses the provided buffer
46 // for code generation and assumes its size to be buffer_size. If the buffer 46 // for code generation and assumes its size to be buffer_size. If the buffer
47 // is too small, a fatal error occurs. No deallocation of the buffer is done 47 // is too small, a fatal error occurs. No deallocation of the buffer is done
48 // upon destruction of the assembler. 48 // upon destruction of the assembler.
49 explicit RegExpMacroAssemblerIrregexp(Vector<byte>); 49 explicit RegExpMacroAssemblerIrregexp(Vector<byte>);
50 virtual ~RegExpMacroAssemblerIrregexp(); 50 virtual ~RegExpMacroAssemblerIrregexp();
51 // The byte-code interpreter checks on each push anyway.
52 virtual int stack_limit() { return 1; }
51 virtual void Bind(Label* label); 53 virtual void Bind(Label* label);
52 virtual void EmitOrLink(Label* label); 54 virtual void EmitOrLink(Label* label);
53 virtual void AdvanceCurrentPosition(int by); // Signed cp change. 55 virtual void AdvanceCurrentPosition(int by); // Signed cp change.
54 virtual void PopCurrentPosition(); 56 virtual void PopCurrentPosition();
55 virtual void PushCurrentPosition(); 57 virtual void PushCurrentPosition(StackCheckFlag check_stack_limit);
56 virtual void Backtrack(); 58 virtual void Backtrack();
57 virtual void GoTo(Label* label); 59 virtual void GoTo(Label* label);
58 virtual void PushBacktrack(Label* label); 60 virtual void PushBacktrack(Label* label, StackCheckFlag check_stack_limit);
59 virtual void Succeed(); 61 virtual void Succeed();
60 virtual void Fail(); 62 virtual void Fail();
61 virtual void PopRegister(int register_index); 63 virtual void PopRegister(int register_index);
62 virtual void PushRegister(int register_index); 64 virtual void PushRegister(int register_index,
65 StackCheckFlag check_stack_limit);
63 virtual void AdvanceRegister(int reg, int by); // r[reg] += by. 66 virtual void AdvanceRegister(int reg, int by); // r[reg] += by.
64 virtual void SetRegister(int register_index, int to); 67 virtual void SetRegister(int register_index, int to);
65 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset); 68 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
66 virtual void ReadCurrentPositionFromRegister(int reg); 69 virtual void ReadCurrentPositionFromRegister(int reg);
67 virtual void WriteStackPointerToRegister(int reg); 70 virtual void WriteStackPointerToRegister(int reg);
68 virtual void ReadStackPointerFromRegister(int reg); 71 virtual void ReadStackPointerFromRegister(int reg);
69 virtual void LoadCurrentCharacter(int cp_offset, 72 virtual void LoadCurrentCharacter(int cp_offset,
70 Label* on_end_of_input, 73 Label* on_end_of_input,
71 bool check_bounds = true, 74 bool check_bounds = true,
72 int characters = 1); 75 int characters = 1);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // True if the assembler owns the buffer, false if buffer is external. 130 // True if the assembler owns the buffer, false if buffer is external.
128 bool own_buffer_; 131 bool own_buffer_;
129 Label backtrack_; 132 Label backtrack_;
130 133
131 DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMacroAssemblerIrregexp); 134 DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMacroAssemblerIrregexp);
132 }; 135 };
133 136
134 } } // namespace v8::internal 137 } } // namespace v8::internal
135 138
136 #endif // V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_ 139 #endif // V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698