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

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

Issue 17378: Capture register clearing on loop iteration (Closed)
Patch Set: 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 void RegExpMacroAssemblerIrregexp::WriteCurrentPositionToRegister( 101 void RegExpMacroAssemblerIrregexp::WriteCurrentPositionToRegister(
102 int register_index, int cp_offset) { 102 int register_index, int cp_offset) {
103 ASSERT(register_index >= 0); 103 ASSERT(register_index >= 0);
104 Emit(BC_SET_REGISTER_TO_CP); 104 Emit(BC_SET_REGISTER_TO_CP);
105 Emit(register_index); 105 Emit(register_index);
106 Emit32(cp_offset); // Current position offset. 106 Emit32(cp_offset); // Current position offset.
107 } 107 }
108 108
109 109
110 void RegExpMacroAssemblerIrregexp::ClearRegister(int reg) {
111 SetRegister(reg, -1);
112 }
113
114
110 void RegExpMacroAssemblerIrregexp::ReadCurrentPositionFromRegister( 115 void RegExpMacroAssemblerIrregexp::ReadCurrentPositionFromRegister(
111 int register_index) { 116 int register_index) {
112 ASSERT(register_index >= 0); 117 ASSERT(register_index >= 0);
113 Emit(BC_SET_CP_TO_REGISTER); 118 Emit(BC_SET_CP_TO_REGISTER);
114 Emit(register_index); 119 Emit(register_index);
115 } 120 }
116 121
117 122
118 void RegExpMacroAssemblerIrregexp::WriteStackPointerToRegister( 123 void RegExpMacroAssemblerIrregexp::WriteStackPointerToRegister(
119 int register_index) { 124 int register_index) {
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 buffer_ = Vector<byte>::New(old_buffer.length() * 2); 441 buffer_ = Vector<byte>::New(old_buffer.length() * 2);
437 own_buffer_ = true; 442 own_buffer_ = true;
438 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); 443 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length());
439 if (old_buffer_was_our_own) { 444 if (old_buffer_was_our_own) {
440 old_buffer.Dispose(); 445 old_buffer.Dispose();
441 } 446 }
442 } 447 }
443 448
444 449
445 } } // namespace v8::internal 450 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698