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

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') | src/v8natives.js » ('J')
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 be8c200cac35788638863bdcf1c1346d49fdd767..878c405f52fea02d417fbfcb75ffe14a7a432c2a 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3609,25 +3609,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);
@@ -3885,7 +3866,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') | src/v8natives.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698