Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: src/scopeinfo.cc

Issue 265553003: StringTable::Lookup*IfExist() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopeinfo.cc
diff --git a/src/scopeinfo.cc b/src/scopeinfo.cc
index eaf9964b16f4a2e75b159f1ef3a1d13841aedb88..a6a2889432407462df226afec6b95e71feae0362 100644
--- a/src/scopeinfo.cc
+++ b/src/scopeinfo.cc
@@ -436,14 +436,14 @@ void ContextSlotCache::Update(Handle<Object> data,
VariableMode mode,
InitializationFlag init_flag,
int slot_index) {
- String* internalized_name;
+ Handle<String> internalized_name;
ASSERT(slot_index > kNotFound);
- if (name->GetIsolate()->heap()->InternalizeStringIfExists(
- *name, &internalized_name)) {
- int index = Hash(*data, internalized_name);
+ if (StringTable::InternalizeStringIfExists(name->GetIsolate(), name).
+ ToHandle(&internalized_name)) {
+ int index = Hash(*data, *internalized_name);
Key& key = keys_[index];
key.data = *data;
- key.name = internalized_name;
+ key.name = *internalized_name;
// Please note value only takes a uint as index.
values_[index] = Value(mode, init_flag, slot_index - kNotFound).raw();
#ifdef DEBUG
@@ -465,9 +465,9 @@ void ContextSlotCache::ValidateEntry(Handle<Object> data,
VariableMode mode,
InitializationFlag init_flag,
int slot_index) {
- String* internalized_name;
- if (name->GetIsolate()->heap()->InternalizeStringIfExists(
- *name, &internalized_name)) {
+ Handle<String> internalized_name;
+ if (StringTable::InternalizeStringIfExists(name->GetIsolate(), name).
+ ToHandle(&internalized_name)) {
int index = Hash(*data, *name);
Key& key = keys_[index];
ASSERT(key.data == *data);
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698