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

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

Issue 6997015: Limit the generation of regexp code with large inlined constants. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 7 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.h ('k') | src/regexp-macro-assembler-irregexp.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 17 matching lines...) Expand all
28 #include "v8.h" 28 #include "v8.h"
29 #include "ast.h" 29 #include "ast.h"
30 #include "assembler.h" 30 #include "assembler.h"
31 #include "regexp-stack.h" 31 #include "regexp-stack.h"
32 #include "regexp-macro-assembler.h" 32 #include "regexp-macro-assembler.h"
33 #include "simulator.h" 33 #include "simulator.h"
34 34
35 namespace v8 { 35 namespace v8 {
36 namespace internal { 36 namespace internal {
37 37
38 RegExpMacroAssembler::RegExpMacroAssembler() { 38 RegExpMacroAssembler::RegExpMacroAssembler() : slow_safe_compiler_(false) {
39 } 39 }
40 40
41 41
42 RegExpMacroAssembler::~RegExpMacroAssembler() { 42 RegExpMacroAssembler::~RegExpMacroAssembler() {
43 } 43 }
44 44
45 45
46 bool RegExpMacroAssembler::CanReadUnaligned() { 46 bool RegExpMacroAssembler::CanReadUnaligned() {
47 #ifdef V8_HOST_CAN_READ_UNALIGNED 47 #ifdef V8_HOST_CAN_READ_UNALIGNED
48 return true; 48 return true;
49 #else 49 #else
50 return false; 50 return false;
51 #endif 51 #endif
52 } 52 }
53 53
54 54
55 #ifndef V8_INTERPRETED_REGEXP // Avoid unused code, e.g., on ARM. 55 #ifndef V8_INTERPRETED_REGEXP // Avoid unused code, e.g., on ARM.
56 56
57 NativeRegExpMacroAssembler::NativeRegExpMacroAssembler() { 57 NativeRegExpMacroAssembler::NativeRegExpMacroAssembler()
58 : RegExpMacroAssembler() {
58 } 59 }
59 60
60 61
61 NativeRegExpMacroAssembler::~NativeRegExpMacroAssembler() { 62 NativeRegExpMacroAssembler::~NativeRegExpMacroAssembler() {
62 } 63 }
63 64
64 65
65 bool NativeRegExpMacroAssembler::CanReadUnaligned() { 66 bool NativeRegExpMacroAssembler::CanReadUnaligned() {
66 #ifdef V8_TARGET_CAN_READ_UNALIGNED 67 #ifdef V8_TARGET_CAN_READ_UNALIGNED
67 return true; 68 return !slow_safe();
68 #else 69 #else
69 return false; 70 return false;
70 #endif 71 #endif
71 } 72 }
72 73
73 const byte* NativeRegExpMacroAssembler::StringCharacterPosition( 74 const byte* NativeRegExpMacroAssembler::StringCharacterPosition(
74 String* subject, 75 String* subject,
75 int start_index) { 76 int start_index) {
76 // Not just flat, but ultra flat. 77 // Not just flat, but ultra flat.
77 ASSERT(subject->IsExternalString() || subject->IsSeqString()); 78 ASSERT(subject->IsExternalString() || subject->IsSeqString());
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 return NULL; 258 return NULL;
258 } 259 }
259 *stack_base = new_stack_base; 260 *stack_base = new_stack_base;
260 intptr_t stack_content_size = old_stack_base - stack_pointer; 261 intptr_t stack_content_size = old_stack_base - stack_pointer;
261 return new_stack_base - stack_content_size; 262 return new_stack_base - stack_content_size;
262 } 263 }
263 264
264 #endif // V8_INTERPRETED_REGEXP 265 #endif // V8_INTERPRETED_REGEXP
265 266
266 } } // namespace v8::internal 267 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/regexp-macro-assembler.h ('k') | src/regexp-macro-assembler-irregexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698