OLD | NEW |
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 15 matching lines...) Expand all Loading... |
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 #ifndef V8_JSREGEXP_INL_H_ | 28 #ifndef V8_JSREGEXP_INL_H_ |
29 #define V8_JSREGEXP_INL_H_ | 29 #define V8_JSREGEXP_INL_H_ |
30 | 30 |
31 | 31 |
32 #include "jsregexp.h" | 32 #include "jsregexp.h" |
33 #include "regexp-macro-assembler.h" | 33 #include "regexp-macro-assembler.h" |
34 | 34 |
35 | 35 |
36 namespace v8 { namespace internal { | 36 namespace v8 { |
| 37 namespace internal { |
37 | 38 |
38 | 39 |
39 template <typename C> | 40 template <typename C> |
40 bool ZoneSplayTree<C>::Insert(const Key& key, Locator* locator) { | 41 bool ZoneSplayTree<C>::Insert(const Key& key, Locator* locator) { |
41 if (is_empty()) { | 42 if (is_empty()) { |
42 // If the tree is empty, insert the new node. | 43 // If the tree is empty, insert the new node. |
43 root_ = new Node(key, C::kNoValue); | 44 root_ = new Node(key, C::kNoValue); |
44 } else { | 45 } else { |
45 // Splay on the key to move the last node on the search path | 46 // Splay on the key to move the last node on the search path |
46 // for the key to the root of the tree. | 47 // for the key to the root of the tree. |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 DoForEach<Node, Callback>(node->left(), callback); | 251 DoForEach<Node, Callback>(node->left(), callback); |
251 callback->Call(node->key(), node->value()); | 252 callback->Call(node->key(), node->value()); |
252 DoForEach<Node, Callback>(node->right(), callback); | 253 DoForEach<Node, Callback>(node->right(), callback); |
253 } | 254 } |
254 | 255 |
255 | 256 |
256 }} // namespace v8::internal | 257 }} // namespace v8::internal |
257 | 258 |
258 | 259 |
259 #endif // V8_JSREGEXP_INL_H_ | 260 #endif // V8_JSREGEXP_INL_H_ |
OLD | NEW |