OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5362 | 5362 |
5363 | 5363 |
5364 bool FunctionTemplate::HasInstance(v8::Handle<v8::Value> value) { | 5364 bool FunctionTemplate::HasInstance(v8::Handle<v8::Value> value) { |
5365 ON_BAILOUT(i::Isolate::Current(), "v8::FunctionTemplate::HasInstanceOf()", | 5365 ON_BAILOUT(i::Isolate::Current(), "v8::FunctionTemplate::HasInstanceOf()", |
5366 return false); | 5366 return false); |
5367 i::Object* obj = *Utils::OpenHandle(*value); | 5367 i::Object* obj = *Utils::OpenHandle(*value); |
5368 return obj->IsInstanceOf(*Utils::OpenHandle(this)); | 5368 return obj->IsInstanceOf(*Utils::OpenHandle(this)); |
5369 } | 5369 } |
5370 | 5370 |
5371 | 5371 |
| 5372 Local<External> v8::External::New(Isolate* isolate, void* value) { |
| 5373 STATIC_ASSERT(sizeof(value) == sizeof(i::Address)); |
| 5374 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 5375 EnsureInitializedForIsolate(i_isolate, "v8::External::New()"); |
| 5376 LOG_API(i_isolate, "External::New"); |
| 5377 ENTER_V8(i_isolate); |
| 5378 i::Handle<i::JSObject> external = i_isolate->factory()->NewExternal(value); |
| 5379 return Utils::ExternalToLocal(external); |
| 5380 } |
| 5381 |
| 5382 |
5372 Local<External> v8::External::New(void* value) { | 5383 Local<External> v8::External::New(void* value) { |
5373 STATIC_ASSERT(sizeof(value) == sizeof(i::Address)); | 5384 return v8::External::New(Isolate::GetCurrent(), value); |
5374 i::Isolate* isolate = i::Isolate::Current(); | |
5375 EnsureInitializedForIsolate(isolate, "v8::External::New()"); | |
5376 LOG_API(isolate, "External::New"); | |
5377 ENTER_V8(isolate); | |
5378 i::Handle<i::JSObject> external = isolate->factory()->NewExternal(value); | |
5379 return Utils::ExternalToLocal(external); | |
5380 } | 5385 } |
5381 | 5386 |
5382 | 5387 |
5383 void* External::Value() const { | 5388 void* External::Value() const { |
5384 return ExternalValue(*Utils::OpenHandle(this)); | 5389 return ExternalValue(*Utils::OpenHandle(this)); |
5385 } | 5390 } |
5386 | 5391 |
5387 | 5392 |
5388 Local<String> v8::String::Empty() { | 5393 Local<String> v8::String::Empty() { |
5389 i::Isolate* isolate = i::Isolate::Current(); | 5394 i::Isolate* isolate = i::Isolate::Current(); |
(...skipping 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7578 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7583 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7579 Address callback_address = | 7584 Address callback_address = |
7580 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7585 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7581 VMState<EXTERNAL> state(isolate); | 7586 VMState<EXTERNAL> state(isolate); |
7582 ExternalCallbackScope call_scope(isolate, callback_address); | 7587 ExternalCallbackScope call_scope(isolate, callback_address); |
7583 callback(info); | 7588 callback(info); |
7584 } | 7589 } |
7585 | 7590 |
7586 | 7591 |
7587 } } // namespace v8::internal | 7592 } } // namespace v8::internal |
OLD | NEW |