OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 47 matching lines...) Loading... |
58 namespace i = v8::internal; | 58 namespace i = v8::internal; |
59 | 59 |
60 class DuplicateFinder { | 60 class DuplicateFinder { |
61 public: | 61 public: |
62 explicit DuplicateFinder(i::UnicodeCache* constants) | 62 explicit DuplicateFinder(i::UnicodeCache* constants) |
63 : unicode_constants_(constants), | 63 : unicode_constants_(constants), |
64 backing_store_(16), | 64 backing_store_(16), |
65 map_(&Match) { } | 65 map_(&Match) { } |
66 | 66 |
67 int AddAsciiSymbol(i::Vector<const char> key, int value); | 67 int AddAsciiSymbol(i::Vector<const char> key, int value); |
68 int AddUC16Symbol(i::Vector<const uint16_t> key, int value); | 68 int AddUtf16Symbol(i::Vector<const uint16_t> key, int value); |
69 // Add a a number literal by converting it (if necessary) | 69 // Add a a number literal by converting it (if necessary) |
70 // to the string that ToString(ToNumber(literal)) would generate. | 70 // to the string that ToString(ToNumber(literal)) would generate. |
71 // and then adding that string with AddAsciiSymbol. | 71 // and then adding that string with AddAsciiSymbol. |
72 // This string is the actual value used as key in an object literal, | 72 // This string is the actual value used as key in an object literal, |
73 // and the one that must be different from the other keys. | 73 // and the one that must be different from the other keys. |
74 int AddNumber(i::Vector<const char> key, int value); | 74 int AddNumber(i::Vector<const char> key, int value); |
75 | 75 |
76 private: | 76 private: |
77 int AddSymbol(i::Vector<const byte> key, bool is_ascii, int value); | 77 int AddSymbol(i::Vector<const byte> key, bool is_ascii, int value); |
78 // Backs up the key and its length in the backing store. | 78 // Backs up the key and its length in the backing store. |
(...skipping 573 matching lines...) Loading... |
652 bool stack_overflow_; | 652 bool stack_overflow_; |
653 bool allow_lazy_; | 653 bool allow_lazy_; |
654 bool allow_modules_; | 654 bool allow_modules_; |
655 bool allow_natives_syntax_; | 655 bool allow_natives_syntax_; |
656 bool parenthesized_function_; | 656 bool parenthesized_function_; |
657 bool harmony_scoping_; | 657 bool harmony_scoping_; |
658 }; | 658 }; |
659 } } // v8::preparser | 659 } } // v8::preparser |
660 | 660 |
661 #endif // V8_PREPARSER_H | 661 #endif // V8_PREPARSER_H |
OLD | NEW |