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 17 matching lines...) Expand all Loading... |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "interface.h" | 30 #include "interface.h" |
31 | 31 |
32 namespace v8 { | 32 namespace v8 { |
33 namespace internal { | 33 namespace internal { |
34 | 34 |
35 static bool Match(void* key1, void* key2) { | 35 static bool Match(void* key1, void* key2) { |
36 String* name1 = *static_cast<String**>(key1); | 36 String* name1 = *static_cast<String**>(key1); |
37 String* name2 = *static_cast<String**>(key2); | 37 String* name2 = *static_cast<String**>(key2); |
38 ASSERT(name1->IsSymbol()); | 38 ASSERT(name1->IsInternalizedString()); |
39 ASSERT(name2->IsSymbol()); | 39 ASSERT(name2->IsInternalizedString()); |
40 return name1 == name2; | 40 return name1 == name2; |
41 } | 41 } |
42 | 42 |
43 | 43 |
44 Interface* Interface::Lookup(Handle<String> name, Zone* zone) { | 44 Interface* Interface::Lookup(Handle<String> name, Zone* zone) { |
45 ASSERT(IsModule()); | 45 ASSERT(IsModule()); |
46 ZoneHashMap* map = Chase()->exports_; | 46 ZoneHashMap* map = Chase()->exports_; |
47 if (map == NULL) return NULL; | 47 if (map == NULL) return NULL; |
48 ZoneAllocationPolicy allocator(zone); | 48 ZoneAllocationPolicy allocator(zone); |
49 ZoneHashMap::Entry* p = map->Lookup(name.location(), name->Hash(), false, | 49 ZoneHashMap::Entry* p = map->Lookup(name.location(), name->Hash(), false, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 PrintF("%*s%s : ", n0 + 2, "", name->ToAsciiArray()); | 235 PrintF("%*s%s : ", n0 + 2, "", name->ToAsciiArray()); |
236 interface->Print(n0 + 2); | 236 interface->Print(n0 + 2); |
237 } | 237 } |
238 PrintF("%*s}\n", n0, ""); | 238 PrintF("%*s}\n", n0, ""); |
239 } | 239 } |
240 } | 240 } |
241 } | 241 } |
242 #endif | 242 #endif |
243 | 243 |
244 } } // namespace v8::internal | 244 } } // namespace v8::internal |
OLD | NEW |