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

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

Issue 18613: Fix endianism issues in regexp interpreter. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/regexp-macro-assembler-irregexp-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return kBytecodeImplementation; 53 return kBytecodeImplementation;
54 } 54 }
55 55
56 56
57 void RegExpMacroAssemblerIrregexp::Bind(Label* l) { 57 void RegExpMacroAssemblerIrregexp::Bind(Label* l) {
58 ASSERT(!l->is_bound()); 58 ASSERT(!l->is_bound());
59 if (l->is_linked()) { 59 if (l->is_linked()) {
60 int pos = l->pos(); 60 int pos = l->pos();
61 while (pos != 0) { 61 while (pos != 0) {
62 int fixup = pos; 62 int fixup = pos;
63 pos = Load32(buffer_.start() + fixup); 63 pos = *reinterpret_cast<int32_t*>(buffer_.start() + fixup);
64 Store32(buffer_.start() + fixup, pc_); 64 *reinterpret_cast<uint32_t*>(buffer_.start() + fixup) = pc_;
65 } 65 }
66 } 66 }
67 l->bind_to(pc_); 67 l->bind_to(pc_);
68 } 68 }
69 69
70 70
71 void RegExpMacroAssemblerIrregexp::EmitOrLink(Label* l) { 71 void RegExpMacroAssemblerIrregexp::EmitOrLink(Label* l) {
72 if (l == NULL) l = &backtrack_; 72 if (l == NULL) l = &backtrack_;
73 if (l->is_bound()) { 73 if (l->is_bound()) {
74 Emit32(l->pos()); 74 Emit32(l->pos());
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 buffer_ = Vector<byte>::New(old_buffer.length() * 2); 440 buffer_ = Vector<byte>::New(old_buffer.length() * 2);
441 own_buffer_ = true; 441 own_buffer_ = true;
442 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); 442 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length());
443 if (old_buffer_was_our_own) { 443 if (old_buffer_was_our_own) {
444 old_buffer.Dispose(); 444 old_buffer.Dispose();
445 } 445 }
446 } 446 }
447 447
448 448
449 } } // namespace v8::internal 449 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/regexp-macro-assembler-irregexp-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698