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

Unified Diff: src/runtime/runtime-object.cc

Issue 1306043003: Move runtime helper for ToName conversion onto Object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-heap-friends
Patch Set: Minor fixup. Created 5 years, 4 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/runtime/runtime-forin.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 9134b39dcadd7679b51ca14072667b57c0d5e553..2dd5db86e127cb228572ca1d9f3c8865340abcfc 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -14,18 +14,6 @@ namespace v8 {
namespace internal {
-MaybeHandle<Name> Runtime::ToName(Isolate* isolate, Handle<Object> key) {
- if (key->IsName()) {
- return Handle<Name>::cast(key);
- } else {
- Handle<Object> converted;
- ASSIGN_RETURN_ON_EXCEPTION(isolate, converted,
- Execution::ToString(isolate, key), Name);
- return Handle<Name>::cast(converted);
- }
-}
-
-
MaybeHandle<Object> Runtime::GetObjectProperty(Isolate* isolate,
Handle<Object> object,
Handle<Object> key,
@@ -45,7 +33,8 @@ MaybeHandle<Object> Runtime::GetObjectProperty(Isolate* isolate,
// Convert the key to a name - possibly by calling back into JavaScript.
Handle<Name> name;
- ASSIGN_RETURN_ON_EXCEPTION(isolate, name, ToName(isolate, key), Object);
+ ASSIGN_RETURN_ON_EXCEPTION(isolate, name, Object::ToName(isolate, key),
+ Object);
// Check if the name is trivially convertible to an index and get
// the element if so.
@@ -150,7 +139,8 @@ MaybeHandle<Object> Runtime::DeleteObjectProperty(Isolate* isolate,
}
Handle<Name> name;
- ASSIGN_RETURN_ON_EXCEPTION(isolate, name, ToName(isolate, key), Object);
+ ASSIGN_RETURN_ON_EXCEPTION(isolate, name, Object::ToName(isolate, key),
+ Object);
return JSReceiver::DeletePropertyOrElement(receiver, name, language_mode);
}
@@ -175,7 +165,8 @@ MaybeHandle<Object> Runtime::SetObjectProperty(Isolate* isolate,
}
Handle<Name> name;
- ASSIGN_RETURN_ON_EXCEPTION(isolate, name, ToName(isolate, key), Object);
+ ASSIGN_RETURN_ON_EXCEPTION(isolate, name, Object::ToName(isolate, key),
+ Object);
LookupIterator it = LookupIterator::PropertyOrElement(isolate, object, name);
return Object::SetProperty(&it, value, language_mode,
« no previous file with comments | « src/runtime/runtime-forin.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698