OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/regexp/jsregexp.h" | 5 #include "src/regexp/jsregexp.h" |
6 | 6 |
7 #include "src/ast.h" | 7 #include "src/ast.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/compilation-cache.h" | 9 #include "src/compilation-cache.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "src/regexp/x87/regexp-macro-assembler-x87.h" | 44 #include "src/regexp/x87/regexp-macro-assembler-x87.h" |
45 #else | 45 #else |
46 #error Unsupported target architecture. | 46 #error Unsupported target architecture. |
47 #endif | 47 #endif |
48 #endif | 48 #endif |
49 | 49 |
50 | 50 |
51 namespace v8 { | 51 namespace v8 { |
52 namespace internal { | 52 namespace internal { |
53 | 53 |
54 MaybeHandle<Object> RegExpImpl::CreateRegExpLiteral( | |
55 Handle<JSFunction> constructor, | |
56 Handle<String> pattern, | |
57 Handle<String> flags) { | |
58 // Call the construct code with 2 arguments. | |
59 Handle<Object> argv[] = { pattern, flags }; | |
60 return Execution::New(constructor, arraysize(argv), argv); | |
61 } | |
62 | |
63 | |
64 MUST_USE_RESULT | 54 MUST_USE_RESULT |
65 static inline MaybeHandle<Object> ThrowRegExpException( | 55 static inline MaybeHandle<Object> ThrowRegExpException( |
66 Handle<JSRegExp> re, Handle<String> pattern, Handle<String> error_text) { | 56 Handle<JSRegExp> re, Handle<String> pattern, Handle<String> error_text) { |
67 Isolate* isolate = re->GetIsolate(); | 57 Isolate* isolate = re->GetIsolate(); |
68 THROW_NEW_ERROR(isolate, NewSyntaxError(MessageTemplate::kMalformedRegExp, | 58 THROW_NEW_ERROR(isolate, NewSyntaxError(MessageTemplate::kMalformedRegExp, |
69 pattern, error_text), | 59 pattern, error_text), |
70 Object); | 60 Object); |
71 } | 61 } |
72 | 62 |
73 | 63 |
(...skipping 6438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6512 | 6502 |
6513 | 6503 |
6514 void RegExpResultsCache::Clear(FixedArray* cache) { | 6504 void RegExpResultsCache::Clear(FixedArray* cache) { |
6515 for (int i = 0; i < kRegExpResultsCacheSize; i++) { | 6505 for (int i = 0; i < kRegExpResultsCacheSize; i++) { |
6516 cache->set(i, Smi::FromInt(0)); | 6506 cache->set(i, Smi::FromInt(0)); |
6517 } | 6507 } |
6518 } | 6508 } |
6519 | 6509 |
6520 } // namespace internal | 6510 } // namespace internal |
6521 } // namespace v8 | 6511 } // namespace v8 |
OLD | NEW |