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 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 | 1387 |
1388 Handle<Object> value() const { return value_; } | 1388 Handle<Object> value() const { return value_; } |
1389 | 1389 |
1390 // Support for using Literal as a HashMap key. NOTE: Currently, this works | 1390 // Support for using Literal as a HashMap key. NOTE: Currently, this works |
1391 // only for string and number literals! | 1391 // only for string and number literals! |
1392 uint32_t Hash() { return ToString()->Hash(); } | 1392 uint32_t Hash() { return ToString()->Hash(); } |
1393 | 1393 |
1394 static bool Match(void* literal1, void* literal2) { | 1394 static bool Match(void* literal1, void* literal2) { |
1395 Handle<String> s1 = static_cast<Literal*>(literal1)->ToString(); | 1395 Handle<String> s1 = static_cast<Literal*>(literal1)->ToString(); |
1396 Handle<String> s2 = static_cast<Literal*>(literal2)->ToString(); | 1396 Handle<String> s2 = static_cast<Literal*>(literal2)->ToString(); |
1397 return s1->Equals(*s2); | 1397 return String::Equals(s1, s2); |
1398 } | 1398 } |
1399 | 1399 |
1400 TypeFeedbackId LiteralFeedbackId() const { return reuse(id()); } | 1400 TypeFeedbackId LiteralFeedbackId() const { return reuse(id()); } |
1401 | 1401 |
1402 protected: | 1402 protected: |
1403 Literal(Zone* zone, Handle<Object> value, int position) | 1403 Literal(Zone* zone, Handle<Object> value, int position) |
1404 : Expression(zone, position), | 1404 : Expression(zone, position), |
1405 value_(value), | 1405 value_(value), |
1406 isolate_(zone->isolate()) { } | 1406 isolate_(zone->isolate()) { } |
1407 | 1407 |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3365 | 3365 |
3366 private: | 3366 private: |
3367 Zone* zone_; | 3367 Zone* zone_; |
3368 Visitor visitor_; | 3368 Visitor visitor_; |
3369 }; | 3369 }; |
3370 | 3370 |
3371 | 3371 |
3372 } } // namespace v8::internal | 3372 } } // namespace v8::internal |
3373 | 3373 |
3374 #endif // V8_AST_H_ | 3374 #endif // V8_AST_H_ |
OLD | NEW |