OLD | NEW |
---|---|
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 Loading... | |
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 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.
| |
4241 return static_cast<int>(self->Hash()); | |
4242 } | |
4243 | |
4244 | |
4234 int String::Length() const { | 4245 int String::Length() const { |
4235 i::Handle<i::String> str = Utils::OpenHandle(this); | 4246 i::Handle<i::String> str = Utils::OpenHandle(this); |
4236 return str->length(); | 4247 return str->length(); |
4237 } | 4248 } |
4238 | 4249 |
4239 | 4250 |
4240 bool String::IsOneByte() const { | 4251 bool String::IsOneByte() const { |
4241 i::Handle<i::String> str = Utils::OpenHandle(this); | 4252 i::Handle<i::String> str = Utils::OpenHandle(this); |
4242 return str->HasOnlyOneByteChars(); | 4253 return str->HasOnlyOneByteChars(); |
4243 } | 4254 } |
(...skipping 3443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7687 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7698 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7688 Address callback_address = | 7699 Address callback_address = |
7689 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7700 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7690 VMState<EXTERNAL> state(isolate); | 7701 VMState<EXTERNAL> state(isolate); |
7691 ExternalCallbackScope call_scope(isolate, callback_address); | 7702 ExternalCallbackScope call_scope(isolate, callback_address); |
7692 callback(info); | 7703 callback(info); |
7693 } | 7704 } |
7694 | 7705 |
7695 | 7706 |
7696 } } // namespace v8::internal | 7707 } } // namespace v8::internal |
OLD | NEW |