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

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

Issue 18842: Experimental: periodic merge of the bleeding_edge branch to the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
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 | « src/regexp-macro-assembler-irregexp.cc ('k') | src/regexp-macro-assembler-tracer.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 18 matching lines...) Expand all
29 29
30 30
31 #include "v8.h" 31 #include "v8.h"
32 #include "ast.h" 32 #include "ast.h"
33 #include "bytecodes-irregexp.h" 33 #include "bytecodes-irregexp.h"
34 34
35 35
36 namespace v8 { namespace internal { 36 namespace v8 { namespace internal {
37 37
38 38
39 void RegExpMacroAssemblerIrregexp::Emit(uint32_t byte) { 39 void RegExpMacroAssemblerIrregexp::Emit(uint32_t byte,
40 uint32_t twenty_four_bits) {
41 uint32_t word = ((twenty_four_bits << BYTECODE_SHIFT) | byte);
40 ASSERT(pc_ <= buffer_.length()); 42 ASSERT(pc_ <= buffer_.length());
41 if (pc_ == buffer_.length()) { 43 if (pc_ + 3 >= buffer_.length()) {
42 Expand(); 44 Expand();
43 } 45 }
44 buffer_[pc_++] = byte; 46 *reinterpret_cast<uint32_t*>(buffer_.start() + pc_) = word;
47 pc_ += 4;
45 } 48 }
46 49
47 50
48 void RegExpMacroAssemblerIrregexp::Emit16(uint32_t word) { 51 void RegExpMacroAssemblerIrregexp::Emit16(uint32_t word) {
49 ASSERT(pc_ <= buffer_.length()); 52 ASSERT(pc_ <= buffer_.length());
50 if (pc_ + 1 >= buffer_.length()) { 53 if (pc_ + 1 >= buffer_.length()) {
51 Expand(); 54 Expand();
52 } 55 }
53 Store16(buffer_.start() + pc_, word); 56 *reinterpret_cast<uint16_t*>(buffer_.start() + pc_) = word;
54 pc_ += 2; 57 pc_ += 2;
55 } 58 }
56 59
57 60
58 void RegExpMacroAssemblerIrregexp::Emit32(uint32_t word) { 61 void RegExpMacroAssemblerIrregexp::Emit32(uint32_t word) {
59 ASSERT(pc_ <= buffer_.length()); 62 ASSERT(pc_ <= buffer_.length());
60 if (pc_ + 3 >= buffer_.length()) { 63 if (pc_ + 3 >= buffer_.length()) {
61 Expand(); 64 Expand();
62 } 65 }
63 Store32(buffer_.start() + pc_, word); 66 *reinterpret_cast<uint32_t*>(buffer_.start() + pc_) = word;
64 pc_ += 4; 67 pc_ += 4;
65 } 68 }
66 69
67 70
68 } } // namespace v8::internal 71 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/regexp-macro-assembler-irregexp.cc ('k') | src/regexp-macro-assembler-tracer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698