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

Side by Side 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: Addressed comments 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 unified diff | Download patch
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 4213 matching lines...) Expand 10 before | Expand all | Expand 10 after
4224 } 4224 }
4225 i::Handle<i::FixedArray> bound_args = i::Handle<i::FixedArray>( 4225 i::Handle<i::FixedArray> bound_args = i::Handle<i::FixedArray>(
4226 i::FixedArray::cast(func->function_bindings())); 4226 i::FixedArray::cast(func->function_bindings()));
4227 i::Handle<i::Object> original( 4227 i::Handle<i::Object> original(
4228 bound_args->get(i::JSFunction::kBoundFunctionIndex), 4228 bound_args->get(i::JSFunction::kBoundFunctionIndex),
4229 func->GetIsolate()); 4229 func->GetIsolate());
4230 return Utils::ToLocal(i::Handle<i::JSFunction>::cast(original)); 4230 return Utils::ToLocal(i::Handle<i::JSFunction>::cast(original));
4231 } 4231 }
4232 4232
4233 4233
4234 int Name::GetIdentityHash() {
4235 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
4236 ON_BAILOUT(isolate, "v8::Name::GetIdentityHash()", return 0);
4237 ENTER_V8(isolate);
4238 i::HandleScope scope(isolate);
4239 i::Handle<i::Name> self = Utils::OpenHandle(this);
4240 return static_cast<int>(self->Hash());
4241 }
4242
4243
4234 int String::Length() const { 4244 int String::Length() const {
4235 i::Handle<i::String> str = Utils::OpenHandle(this); 4245 i::Handle<i::String> str = Utils::OpenHandle(this);
4236 return str->length(); 4246 return str->length();
4237 } 4247 }
4238 4248
4239 4249
4240 bool String::IsOneByte() const { 4250 bool String::IsOneByte() const {
4241 i::Handle<i::String> str = Utils::OpenHandle(this); 4251 i::Handle<i::String> str = Utils::OpenHandle(this);
4242 return str->HasOnlyOneByteChars(); 4252 return str->HasOnlyOneByteChars();
4243 } 4253 }
(...skipping 3443 matching lines...) Expand 10 before | Expand all | Expand 10 after
7687 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7697 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7688 Address callback_address = 7698 Address callback_address =
7689 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7699 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7690 VMState<EXTERNAL> state(isolate); 7700 VMState<EXTERNAL> state(isolate);
7691 ExternalCallbackScope call_scope(isolate, callback_address); 7701 ExternalCallbackScope call_scope(isolate, callback_address);
7692 callback(info); 7702 callback(info);
7693 } 7703 }
7694 7704
7695 7705
7696 } } // namespace v8::internal 7706 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698