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

Unified Diff: src/api.cc

Issue 753373003: Add GetIdentityHash to v8::Name object API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 58c08f59c69ac39bd0f50729f3559fae748b9c9c..d349d59f13f82d9a7adf28303beb5b9035a40b8c 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -4231,6 +4231,17 @@ Local<v8::Value> Function::GetBoundFunction() const {
}
+int Name::GetIdentityHash() {
+ i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
+ ON_BAILOUT(isolate, "v8::Name::GetIdentityHash()", return 0);
+ ENTER_V8(isolate);
+ i::HandleScope scope(isolate);
+ i::Handle<i::Name> self = Utils::OpenHandle(this);
+ DCHECK(!self->IsSymbol() || self->HasHashCode());
aandrey 2014/12/01 15:49:17 why checking self->HasHashCode()? just remove this
Yang 2014/12/02 07:55:44 agree.
yurys 2014/12/02 08:42:30 Done.
yurys 2014/12/02 08:42:30 Done.
+ return static_cast<int>(self->Hash());
+}
+
+
int String::Length() const {
i::Handle<i::String> str = Utils::OpenHandle(this);
return str->length();

Powered by Google App Engine
This is Rietveld 408576698