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

Unified Diff: src/api.cc

Issue 1224523002: Avoid converting key to string for deleting of elements (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | src/array.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 2402725263f1bbbf12ed668b7674a4dd643bf5ec..c503b033affb34be8f1cc1fe61e0843f18a2b9bf 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3607,25 +3607,6 @@ bool v8::Object::ForceSet(v8::Handle<Value> key, v8::Handle<Value> value,
}
-MUST_USE_RESULT
-static i::MaybeHandle<i::Object> DeleteObjectProperty(
- i::Isolate* isolate, i::Handle<i::JSReceiver> receiver,
- i::Handle<i::Object> key, i::LanguageMode language_mode) {
- // Check if the given key is an array index.
- uint32_t index = 0;
- if (key->ToArrayIndex(&index)) {
- return i::JSReceiver::DeleteElement(receiver, index, language_mode);
- }
-
- i::Handle<i::Name> name;
- ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, name,
- i::Runtime::ToName(isolate, key),
- i::MaybeHandle<i::Object>());
-
- return i::JSReceiver::DeletePropertyOrElement(receiver, name, language_mode);
-}
-
-
MaybeLocal<Value> v8::Object::Get(Local<v8::Context> context,
Local<Value> key) {
PREPARE_FOR_EXECUTION(context, "v8::Object::Get()", Value);
@@ -3883,7 +3864,8 @@ Maybe<bool> v8::Object::Delete(Local<Context> context, Local<Value> key) {
auto key_obj = Utils::OpenHandle(*key);
i::Handle<i::Object> obj;
has_pending_exception =
- !DeleteObjectProperty(isolate, self, key_obj, i::SLOPPY).ToHandle(&obj);
+ !i::Runtime::DeleteObjectProperty(isolate, self, key_obj, i::SLOPPY)
+ .ToHandle(&obj);
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
return Just(obj->IsTrue());
}
« no previous file with comments | « no previous file | src/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698