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

Side by Side Diff: src/assembler-irregexp-inl.h

Issue 11600: * Rename to Irregexp throughout.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 years 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 | Annotate | Revision Log
Property Changes:
Added: svn:mergeinfo
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 12 matching lines...) Expand all
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 // A light-weight assembler for the Regexp2000 byte code. 28 // A light-weight assembler for the Regexp2000 byte code.
29 29
30 30
31 #include "v8.h" 31 #include "v8.h"
32 #include "ast.h" 32 #include "ast.h"
33 #include "bytecodes-re2k.h" 33 #include "bytecodes-irregexp.h"
34 #include "assembler-re2k.h" 34 #include "assembler-irregexp.h"
35 35
36 36
37 namespace v8 { namespace internal { 37 namespace v8 { namespace internal {
38 38
39 39
40 void Re2kAssembler::Emit(uint32_t byte) { 40 void IrregexpAssembler::Emit(uint32_t byte) {
41 ASSERT(pc_ <= buffer_.length()); 41 ASSERT(pc_ <= buffer_.length());
42 if (pc_ == buffer_.length()) { 42 if (pc_ == buffer_.length()) {
43 Expand(); 43 Expand();
44 } 44 }
45 buffer_[pc_++] = byte; 45 buffer_[pc_++] = byte;
46 } 46 }
47 47
48 48
49 void Re2kAssembler::Emit16(uint32_t word) { 49 void IrregexpAssembler::Emit16(uint32_t word) {
50 ASSERT(pc_ <= buffer_.length()); 50 ASSERT(pc_ <= buffer_.length());
51 if (pc_ + 1 >= buffer_.length()) { 51 if (pc_ + 1 >= buffer_.length()) {
52 Expand(); 52 Expand();
53 } 53 }
54 Store16(buffer_.start() + pc_, word); 54 Store16(buffer_.start() + pc_, word);
55 pc_ += 2; 55 pc_ += 2;
56 } 56 }
57 57
58 58
59 void Re2kAssembler::Emit32(uint32_t word) { 59 void IrregexpAssembler::Emit32(uint32_t word) {
60 ASSERT(pc_ <= buffer_.length()); 60 ASSERT(pc_ <= buffer_.length());
61 if (pc_ + 3 >= buffer_.length()) { 61 if (pc_ + 3 >= buffer_.length()) {
62 Expand(); 62 Expand();
63 } 63 }
64 Store32(buffer_.start() + pc_, word); 64 Store32(buffer_.start() + pc_, word);
65 pc_ += 4; 65 pc_ += 4;
66 } 66 }
67 67
68 68
69 void Re2kAssembler::EmitOrLink(Label* l) { 69 void IrregexpAssembler::EmitOrLink(Label* l) {
70 if (l->is_bound()) { 70 if (l->is_bound()) {
71 Emit32(l->pos()); 71 Emit32(l->pos());
72 } else { 72 } else {
73 int pos = 0; 73 int pos = 0;
74 if (l->is_linked()) { 74 if (l->is_linked()) {
75 pos = l->pos(); 75 pos = l->pos();
76 } 76 }
77 l->link_to(pc_); 77 l->link_to(pc_);
78 Emit32(pos); 78 Emit32(pos);
79 } 79 }
80 } 80 }
81 81
82 } } // namespace v8::internal 82 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler-irregexp.cc ('k') | src/assembler-re2k.h » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698