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 3302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3313 | 3313 |
3314 // Copy the buffer into a heap-allocated string and return it. | 3314 // Copy the buffer into a heap-allocated string and return it. |
3315 Local<String> result = v8::String::NewFromUtf8( | 3315 Local<String> result = v8::String::NewFromUtf8( |
3316 isolate, buf.start(), String::kNormalString, buf_len); | 3316 isolate, buf.start(), String::kNormalString, buf_len); |
3317 return result; | 3317 return result; |
3318 } | 3318 } |
3319 } | 3319 } |
3320 } | 3320 } |
3321 | 3321 |
3322 | 3322 |
3323 Local<Value> v8::Object::GetConstructor() { | |
3324 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | |
3325 ON_BAILOUT(isolate, "v8::Object::GetConstructor()", | |
3326 return Local<v8::Function>()); | |
3327 ENTER_V8(isolate); | |
3328 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | |
3329 i::Handle<i::Object> constructor(self->GetConstructor(), isolate); | |
3330 return Utils::ToLocal(constructor); | |
3331 } | |
3332 | |
3333 | |
3334 Local<String> v8::Object::GetConstructorName() { | 3323 Local<String> v8::Object::GetConstructorName() { |
3335 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3324 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3336 ON_BAILOUT(isolate, "v8::Object::GetConstructorName()", | 3325 ON_BAILOUT(isolate, "v8::Object::GetConstructorName()", |
3337 return Local<v8::String>()); | 3326 return Local<v8::String>()); |
3338 ENTER_V8(isolate); | 3327 ENTER_V8(isolate); |
3339 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3328 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
3340 i::Handle<i::String> name(self->constructor_name()); | 3329 i::Handle<i::String> name(self->constructor_name()); |
3341 return Utils::ToLocal(name); | 3330 return Utils::ToLocal(name); |
3342 } | 3331 } |
3343 | 3332 |
(...skipping 4290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7634 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7623 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7635 Address callback_address = | 7624 Address callback_address = |
7636 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7625 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7637 VMState<EXTERNAL> state(isolate); | 7626 VMState<EXTERNAL> state(isolate); |
7638 ExternalCallbackScope call_scope(isolate, callback_address); | 7627 ExternalCallbackScope call_scope(isolate, callback_address); |
7639 callback(info); | 7628 callback(info); |
7640 } | 7629 } |
7641 | 7630 |
7642 | 7631 |
7643 } } // namespace v8::internal | 7632 } } // namespace v8::internal |
OLD | NEW |