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 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 i::FixedArray* types = i::FixedArray::cast(info->types()); | 1257 i::FixedArray* types = i::FixedArray::cast(info->types()); |
1258 for (int i = 0; i < types->length(); i++) { | 1258 for (int i = 0; i < types->length(); i++) { |
1259 if (obj->IsInstanceOf(i::FunctionTemplateInfo::cast(types->get(i)))) | 1259 if (obj->IsInstanceOf(i::FunctionTemplateInfo::cast(types->get(i)))) |
1260 return i + 1; | 1260 return i + 1; |
1261 } | 1261 } |
1262 return 0; | 1262 return 0; |
1263 } | 1263 } |
1264 | 1264 |
1265 | 1265 |
1266 #define SET_FIELD_WRAPPED(obj, setter, cdata) do { \ | 1266 #define SET_FIELD_WRAPPED(obj, setter, cdata) do { \ |
1267 i::Handle<i::Object> foreign = FromCData(cdata); \ | 1267 i::Handle<i::Object> foreign = FromCData(obj->GetIsolate(), cdata); \ |
1268 (obj)->setter(*foreign); \ | 1268 (obj)->setter(*foreign); \ |
1269 } while (false) | 1269 } while (false) |
1270 | 1270 |
1271 | 1271 |
1272 void FunctionTemplate::SetCallHandler(FunctionCallback callback, | 1272 void FunctionTemplate::SetCallHandler(FunctionCallback callback, |
1273 v8::Handle<Value> data) { | 1273 v8::Handle<Value> data) { |
1274 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 1274 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
1275 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetCallHandler()")) return; | 1275 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetCallHandler()")) return; |
1276 ENTER_V8(isolate); | 1276 ENTER_V8(isolate); |
1277 i::HandleScope scope(isolate); | 1277 i::HandleScope scope(isolate); |
(...skipping 6585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7863 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7863 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7864 Address callback_address = | 7864 Address callback_address = |
7865 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7865 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7866 VMState<EXTERNAL> state(isolate); | 7866 VMState<EXTERNAL> state(isolate); |
7867 ExternalCallbackScope call_scope(isolate, callback_address); | 7867 ExternalCallbackScope call_scope(isolate, callback_address); |
7868 return callback(info); | 7868 return callback(info); |
7869 } | 7869 } |
7870 | 7870 |
7871 | 7871 |
7872 } } // namespace v8::internal | 7872 } } // namespace v8::internal |
OLD | NEW |