Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 14769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14780 if (entry == kNotFound) { | 14780 if (entry == kNotFound) { |
| 14781 return MaybeHandle<String>(); | 14781 return MaybeHandle<String>(); |
| 14782 } else { | 14782 } else { |
| 14783 Handle<String> result(String::cast(string_table->KeyAt(entry)), isolate); | 14783 Handle<String> result(String::cast(string_table->KeyAt(entry)), isolate); |
| 14784 DCHECK(StringShape(*result).IsInternalized()); | 14784 DCHECK(StringShape(*result).IsInternalized()); |
| 14785 return result; | 14785 return result; |
| 14786 } | 14786 } |
| 14787 } | 14787 } |
| 14788 | 14788 |
| 14789 | 14789 |
| 14790 void StringTable::EnsureCapacityForDeserialization(Isolate* isolate, int n) { | |
|
mvstanton
2014/10/23 07:29:39
nit: how about size or length instead of n.
| |
| 14791 Handle<StringTable> table = isolate->factory()->string_table(); | |
| 14792 // We need a key instance for the virtual hash function. | |
| 14793 InternalizedStringKey dummy_key(Handle<String>::null()); | |
| 14794 table = StringTable::EnsureCapacity(table, n, &dummy_key); | |
| 14795 isolate->factory()->set_string_table(table); | |
| 14796 } | |
| 14797 | |
| 14798 | |
| 14790 Handle<String> StringTable::LookupString(Isolate* isolate, | 14799 Handle<String> StringTable::LookupString(Isolate* isolate, |
| 14791 Handle<String> string) { | 14800 Handle<String> string) { |
| 14792 InternalizedStringKey key(string); | 14801 InternalizedStringKey key(string); |
| 14793 return LookupKey(isolate, &key); | 14802 return LookupKey(isolate, &key); |
| 14794 } | 14803 } |
| 14795 | 14804 |
| 14796 | 14805 |
| 14797 Handle<String> StringTable::LookupKey(Isolate* isolate, HashTableKey* key) { | 14806 Handle<String> StringTable::LookupKey(Isolate* isolate, HashTableKey* key) { |
| 14798 Handle<StringTable> table = isolate->factory()->string_table(); | 14807 Handle<StringTable> table = isolate->factory()->string_table(); |
| 14799 int entry = table->FindEntry(key); | 14808 int entry = table->FindEntry(key); |
| (...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 16469 Handle<DependentCode> codes = | 16478 Handle<DependentCode> codes = |
| 16470 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16479 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
| 16471 DependentCode::kPropertyCellChangedGroup, | 16480 DependentCode::kPropertyCellChangedGroup, |
| 16472 info->object_wrapper()); | 16481 info->object_wrapper()); |
| 16473 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16482 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
| 16474 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16483 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 16475 cell, info->zone()); | 16484 cell, info->zone()); |
| 16476 } | 16485 } |
| 16477 | 16486 |
| 16478 } } // namespace v8::internal | 16487 } } // namespace v8::internal |
| OLD | NEW |