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 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 if (!constructor.IsEmpty()) | 1361 if (!constructor.IsEmpty()) |
1362 obj->set_constructor(*Utils::OpenHandle(*constructor)); | 1362 obj->set_constructor(*Utils::OpenHandle(*constructor)); |
1363 obj->set_internal_field_count(i::Smi::FromInt(0)); | 1363 obj->set_internal_field_count(i::Smi::FromInt(0)); |
1364 return Utils::ToLocal(obj); | 1364 return Utils::ToLocal(obj); |
1365 } | 1365 } |
1366 | 1366 |
1367 | 1367 |
1368 // Ensure that the object template has a constructor. If no | 1368 // Ensure that the object template has a constructor. If no |
1369 // constructor is available we create one. | 1369 // constructor is available we create one. |
1370 static i::Handle<i::FunctionTemplateInfo> EnsureConstructor( | 1370 static i::Handle<i::FunctionTemplateInfo> EnsureConstructor( |
| 1371 i::Isolate* isolate, |
1371 ObjectTemplate* object_template) { | 1372 ObjectTemplate* object_template) { |
1372 i::Object* obj = Utils::OpenHandle(object_template)->constructor(); | 1373 i::Object* obj = Utils::OpenHandle(object_template)->constructor(); |
1373 if (!obj ->IsUndefined()) { | 1374 if (!obj ->IsUndefined()) { |
1374 i::FunctionTemplateInfo* info = i::FunctionTemplateInfo::cast(obj); | 1375 i::FunctionTemplateInfo* info = i::FunctionTemplateInfo::cast(obj); |
1375 return i::Handle<i::FunctionTemplateInfo>(info, info->GetIsolate()); | 1376 return i::Handle<i::FunctionTemplateInfo>(info, isolate); |
1376 } | 1377 } |
1377 Local<FunctionTemplate> templ = FunctionTemplate::New(); | 1378 Local<FunctionTemplate> templ = |
| 1379 FunctionTemplate::New(reinterpret_cast<Isolate*>(isolate)); |
1378 i::Handle<i::FunctionTemplateInfo> constructor = Utils::OpenHandle(*templ); | 1380 i::Handle<i::FunctionTemplateInfo> constructor = Utils::OpenHandle(*templ); |
1379 constructor->set_instance_template(*Utils::OpenHandle(object_template)); | 1381 constructor->set_instance_template(*Utils::OpenHandle(object_template)); |
1380 Utils::OpenHandle(object_template)->set_constructor(*constructor); | 1382 Utils::OpenHandle(object_template)->set_constructor(*constructor); |
1381 return constructor; | 1383 return constructor; |
1382 } | 1384 } |
1383 | 1385 |
1384 | 1386 |
1385 static inline void AddPropertyToTemplate( | 1387 static inline void AddPropertyToTemplate( |
1386 i::Handle<i::TemplateInfo> info, | 1388 i::Handle<i::TemplateInfo> info, |
1387 i::Handle<i::AccessorInfo> obj) { | 1389 i::Handle<i::AccessorInfo> obj) { |
1388 i::Handle<i::Object> list(info->property_accessors(), info->GetIsolate()); | 1390 i::Handle<i::Object> list(info->property_accessors(), info->GetIsolate()); |
1389 if (list->IsUndefined()) { | 1391 if (list->IsUndefined()) { |
1390 list = NeanderArray().value(); | 1392 list = NeanderArray().value(); |
1391 info->set_property_accessors(*list); | 1393 info->set_property_accessors(*list); |
1392 } | 1394 } |
1393 NeanderArray array(list); | 1395 NeanderArray array(list); |
1394 array.add(obj); | 1396 array.add(obj); |
1395 } | 1397 } |
1396 | 1398 |
1397 | 1399 |
1398 static inline i::Handle<i::TemplateInfo> GetTemplateInfo( | 1400 static inline i::Handle<i::TemplateInfo> GetTemplateInfo( |
| 1401 i::Isolate* isolate, |
1399 Template* template_obj) { | 1402 Template* template_obj) { |
1400 return Utils::OpenHandle(template_obj); | 1403 return Utils::OpenHandle(template_obj); |
1401 } | 1404 } |
1402 | 1405 |
1403 | 1406 |
1404 // TODO(dcarney): remove this with ObjectTemplate::SetAccessor | 1407 // TODO(dcarney): remove this with ObjectTemplate::SetAccessor |
1405 static inline i::Handle<i::TemplateInfo> GetTemplateInfo( | 1408 static inline i::Handle<i::TemplateInfo> GetTemplateInfo( |
| 1409 i::Isolate* isolate, |
1406 ObjectTemplate* object_template) { | 1410 ObjectTemplate* object_template) { |
1407 EnsureConstructor(object_template); | 1411 EnsureConstructor(isolate, object_template); |
1408 return Utils::OpenHandle(object_template); | 1412 return Utils::OpenHandle(object_template); |
1409 } | 1413 } |
1410 | 1414 |
1411 | 1415 |
1412 template<typename Setter, typename Getter, typename Data, typename Template> | 1416 template<typename Setter, typename Getter, typename Data, typename Template> |
1413 static bool TemplateSetAccessor( | 1417 static bool TemplateSetAccessor( |
1414 Template* template_obj, | 1418 Template* template_obj, |
1415 v8::Local<String> name, | 1419 v8::Local<String> name, |
1416 Getter getter, | 1420 Getter getter, |
1417 Setter setter, | 1421 Setter setter, |
1418 Data data, | 1422 Data data, |
1419 AccessControl settings, | 1423 AccessControl settings, |
1420 PropertyAttribute attribute, | 1424 PropertyAttribute attribute, |
1421 v8::Local<AccessorSignature> signature) { | 1425 v8::Local<AccessorSignature> signature) { |
1422 i::Isolate* isolate = Utils::OpenHandle(template_obj)->GetIsolate(); | 1426 i::Isolate* isolate = Utils::OpenHandle(template_obj)->GetIsolate(); |
1423 ENTER_V8(isolate); | 1427 ENTER_V8(isolate); |
1424 i::HandleScope scope(isolate); | 1428 i::HandleScope scope(isolate); |
1425 i::Handle<i::AccessorInfo> obj = MakeAccessorInfo( | 1429 i::Handle<i::AccessorInfo> obj = MakeAccessorInfo( |
1426 name, getter, setter, data, settings, attribute, signature); | 1430 name, getter, setter, data, settings, attribute, signature); |
1427 if (obj.is_null()) return false; | 1431 if (obj.is_null()) return false; |
1428 i::Handle<i::TemplateInfo> info = GetTemplateInfo(template_obj); | 1432 i::Handle<i::TemplateInfo> info = GetTemplateInfo(isolate, template_obj); |
1429 AddPropertyToTemplate(info, obj); | 1433 AddPropertyToTemplate(info, obj); |
1430 return true; | 1434 return true; |
1431 } | 1435 } |
1432 | 1436 |
1433 | 1437 |
1434 bool Template::SetDeclaredAccessor( | 1438 bool Template::SetDeclaredAccessor( |
1435 Local<String> name, | 1439 Local<String> name, |
1436 Local<DeclaredAccessorDescriptor> descriptor, | 1440 Local<DeclaredAccessorDescriptor> descriptor, |
1437 PropertyAttribute attribute, | 1441 PropertyAttribute attribute, |
1438 Local<AccessorSignature> signature, | 1442 Local<AccessorSignature> signature, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1470 void ObjectTemplate::SetNamedPropertyHandler( | 1474 void ObjectTemplate::SetNamedPropertyHandler( |
1471 NamedPropertyGetterCallback getter, | 1475 NamedPropertyGetterCallback getter, |
1472 NamedPropertySetterCallback setter, | 1476 NamedPropertySetterCallback setter, |
1473 NamedPropertyQueryCallback query, | 1477 NamedPropertyQueryCallback query, |
1474 NamedPropertyDeleterCallback remover, | 1478 NamedPropertyDeleterCallback remover, |
1475 NamedPropertyEnumeratorCallback enumerator, | 1479 NamedPropertyEnumeratorCallback enumerator, |
1476 Handle<Value> data) { | 1480 Handle<Value> data) { |
1477 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 1481 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
1478 ENTER_V8(isolate); | 1482 ENTER_V8(isolate); |
1479 i::HandleScope scope(isolate); | 1483 i::HandleScope scope(isolate); |
1480 EnsureConstructor(this); | 1484 EnsureConstructor(isolate, this); |
1481 i::FunctionTemplateInfo* constructor = i::FunctionTemplateInfo::cast( | 1485 i::FunctionTemplateInfo* constructor = i::FunctionTemplateInfo::cast( |
1482 Utils::OpenHandle(this)->constructor()); | 1486 Utils::OpenHandle(this)->constructor()); |
1483 i::Handle<i::FunctionTemplateInfo> cons(constructor); | 1487 i::Handle<i::FunctionTemplateInfo> cons(constructor); |
1484 i::Handle<i::Struct> struct_obj = | 1488 i::Handle<i::Struct> struct_obj = |
1485 isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE); | 1489 isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE); |
1486 i::Handle<i::InterceptorInfo> obj = | 1490 i::Handle<i::InterceptorInfo> obj = |
1487 i::Handle<i::InterceptorInfo>::cast(struct_obj); | 1491 i::Handle<i::InterceptorInfo>::cast(struct_obj); |
1488 | 1492 |
1489 if (getter != 0) SET_FIELD_WRAPPED(obj, set_getter, getter); | 1493 if (getter != 0) SET_FIELD_WRAPPED(obj, set_getter, getter); |
1490 if (setter != 0) SET_FIELD_WRAPPED(obj, set_setter, setter); | 1494 if (setter != 0) SET_FIELD_WRAPPED(obj, set_setter, setter); |
1491 if (query != 0) SET_FIELD_WRAPPED(obj, set_query, query); | 1495 if (query != 0) SET_FIELD_WRAPPED(obj, set_query, query); |
1492 if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover); | 1496 if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover); |
1493 if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator); | 1497 if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator); |
1494 | 1498 |
1495 if (data.IsEmpty()) { | 1499 if (data.IsEmpty()) { |
1496 data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate)); | 1500 data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate)); |
1497 } | 1501 } |
1498 obj->set_data(*Utils::OpenHandle(*data)); | 1502 obj->set_data(*Utils::OpenHandle(*data)); |
1499 cons->set_named_property_handler(*obj); | 1503 cons->set_named_property_handler(*obj); |
1500 } | 1504 } |
1501 | 1505 |
1502 | 1506 |
1503 void ObjectTemplate::MarkAsUndetectable() { | 1507 void ObjectTemplate::MarkAsUndetectable() { |
1504 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 1508 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
1505 ENTER_V8(isolate); | 1509 ENTER_V8(isolate); |
1506 i::HandleScope scope(isolate); | 1510 i::HandleScope scope(isolate); |
1507 EnsureConstructor(this); | 1511 EnsureConstructor(isolate, this); |
1508 i::FunctionTemplateInfo* constructor = | 1512 i::FunctionTemplateInfo* constructor = |
1509 i::FunctionTemplateInfo::cast(Utils::OpenHandle(this)->constructor()); | 1513 i::FunctionTemplateInfo::cast(Utils::OpenHandle(this)->constructor()); |
1510 i::Handle<i::FunctionTemplateInfo> cons(constructor); | 1514 i::Handle<i::FunctionTemplateInfo> cons(constructor); |
1511 cons->set_undetectable(true); | 1515 cons->set_undetectable(true); |
1512 } | 1516 } |
1513 | 1517 |
1514 | 1518 |
1515 void ObjectTemplate::SetAccessCheckCallbacks( | 1519 void ObjectTemplate::SetAccessCheckCallbacks( |
1516 NamedSecurityCallback named_callback, | 1520 NamedSecurityCallback named_callback, |
1517 IndexedSecurityCallback indexed_callback, | 1521 IndexedSecurityCallback indexed_callback, |
1518 Handle<Value> data, | 1522 Handle<Value> data, |
1519 bool turned_on_by_default) { | 1523 bool turned_on_by_default) { |
1520 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 1524 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
1521 ENTER_V8(isolate); | 1525 ENTER_V8(isolate); |
1522 i::HandleScope scope(isolate); | 1526 i::HandleScope scope(isolate); |
1523 EnsureConstructor(this); | 1527 EnsureConstructor(isolate, this); |
1524 | 1528 |
1525 i::Handle<i::Struct> struct_info = | 1529 i::Handle<i::Struct> struct_info = |
1526 isolate->factory()->NewStruct(i::ACCESS_CHECK_INFO_TYPE); | 1530 isolate->factory()->NewStruct(i::ACCESS_CHECK_INFO_TYPE); |
1527 i::Handle<i::AccessCheckInfo> info = | 1531 i::Handle<i::AccessCheckInfo> info = |
1528 i::Handle<i::AccessCheckInfo>::cast(struct_info); | 1532 i::Handle<i::AccessCheckInfo>::cast(struct_info); |
1529 | 1533 |
1530 SET_FIELD_WRAPPED(info, set_named_callback, named_callback); | 1534 SET_FIELD_WRAPPED(info, set_named_callback, named_callback); |
1531 SET_FIELD_WRAPPED(info, set_indexed_callback, indexed_callback); | 1535 SET_FIELD_WRAPPED(info, set_indexed_callback, indexed_callback); |
1532 | 1536 |
1533 if (data.IsEmpty()) { | 1537 if (data.IsEmpty()) { |
(...skipping 12 matching lines...) Expand all Loading... |
1546 void ObjectTemplate::SetIndexedPropertyHandler( | 1550 void ObjectTemplate::SetIndexedPropertyHandler( |
1547 IndexedPropertyGetterCallback getter, | 1551 IndexedPropertyGetterCallback getter, |
1548 IndexedPropertySetterCallback setter, | 1552 IndexedPropertySetterCallback setter, |
1549 IndexedPropertyQueryCallback query, | 1553 IndexedPropertyQueryCallback query, |
1550 IndexedPropertyDeleterCallback remover, | 1554 IndexedPropertyDeleterCallback remover, |
1551 IndexedPropertyEnumeratorCallback enumerator, | 1555 IndexedPropertyEnumeratorCallback enumerator, |
1552 Handle<Value> data) { | 1556 Handle<Value> data) { |
1553 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 1557 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
1554 ENTER_V8(isolate); | 1558 ENTER_V8(isolate); |
1555 i::HandleScope scope(isolate); | 1559 i::HandleScope scope(isolate); |
1556 EnsureConstructor(this); | 1560 EnsureConstructor(isolate, this); |
1557 i::FunctionTemplateInfo* constructor = i::FunctionTemplateInfo::cast( | 1561 i::FunctionTemplateInfo* constructor = i::FunctionTemplateInfo::cast( |
1558 Utils::OpenHandle(this)->constructor()); | 1562 Utils::OpenHandle(this)->constructor()); |
1559 i::Handle<i::FunctionTemplateInfo> cons(constructor); | 1563 i::Handle<i::FunctionTemplateInfo> cons(constructor); |
1560 i::Handle<i::Struct> struct_obj = | 1564 i::Handle<i::Struct> struct_obj = |
1561 isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE); | 1565 isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE); |
1562 i::Handle<i::InterceptorInfo> obj = | 1566 i::Handle<i::InterceptorInfo> obj = |
1563 i::Handle<i::InterceptorInfo>::cast(struct_obj); | 1567 i::Handle<i::InterceptorInfo>::cast(struct_obj); |
1564 | 1568 |
1565 if (getter != 0) SET_FIELD_WRAPPED(obj, set_getter, getter); | 1569 if (getter != 0) SET_FIELD_WRAPPED(obj, set_getter, getter); |
1566 if (setter != 0) SET_FIELD_WRAPPED(obj, set_setter, setter); | 1570 if (setter != 0) SET_FIELD_WRAPPED(obj, set_setter, setter); |
1567 if (query != 0) SET_FIELD_WRAPPED(obj, set_query, query); | 1571 if (query != 0) SET_FIELD_WRAPPED(obj, set_query, query); |
1568 if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover); | 1572 if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover); |
1569 if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator); | 1573 if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator); |
1570 | 1574 |
1571 if (data.IsEmpty()) { | 1575 if (data.IsEmpty()) { |
1572 data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate)); | 1576 data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate)); |
1573 } | 1577 } |
1574 obj->set_data(*Utils::OpenHandle(*data)); | 1578 obj->set_data(*Utils::OpenHandle(*data)); |
1575 cons->set_indexed_property_handler(*obj); | 1579 cons->set_indexed_property_handler(*obj); |
1576 } | 1580 } |
1577 | 1581 |
1578 | 1582 |
1579 void ObjectTemplate::SetCallAsFunctionHandler(FunctionCallback callback, | 1583 void ObjectTemplate::SetCallAsFunctionHandler(FunctionCallback callback, |
1580 Handle<Value> data) { | 1584 Handle<Value> data) { |
1581 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 1585 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
1582 ENTER_V8(isolate); | 1586 ENTER_V8(isolate); |
1583 i::HandleScope scope(isolate); | 1587 i::HandleScope scope(isolate); |
1584 EnsureConstructor(this); | 1588 EnsureConstructor(isolate, this); |
1585 i::FunctionTemplateInfo* constructor = i::FunctionTemplateInfo::cast( | 1589 i::FunctionTemplateInfo* constructor = i::FunctionTemplateInfo::cast( |
1586 Utils::OpenHandle(this)->constructor()); | 1590 Utils::OpenHandle(this)->constructor()); |
1587 i::Handle<i::FunctionTemplateInfo> cons(constructor); | 1591 i::Handle<i::FunctionTemplateInfo> cons(constructor); |
1588 i::Handle<i::Struct> struct_obj = | 1592 i::Handle<i::Struct> struct_obj = |
1589 isolate->factory()->NewStruct(i::CALL_HANDLER_INFO_TYPE); | 1593 isolate->factory()->NewStruct(i::CALL_HANDLER_INFO_TYPE); |
1590 i::Handle<i::CallHandlerInfo> obj = | 1594 i::Handle<i::CallHandlerInfo> obj = |
1591 i::Handle<i::CallHandlerInfo>::cast(struct_obj); | 1595 i::Handle<i::CallHandlerInfo>::cast(struct_obj); |
1592 SET_FIELD_WRAPPED(obj, set_callback, callback); | 1596 SET_FIELD_WRAPPED(obj, set_callback, callback); |
1593 if (data.IsEmpty()) { | 1597 if (data.IsEmpty()) { |
1594 data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate)); | 1598 data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate)); |
(...skipping 13 matching lines...) Expand all Loading... |
1608 if (!ApiCheck(i::Smi::IsValid(value), | 1612 if (!ApiCheck(i::Smi::IsValid(value), |
1609 "v8::ObjectTemplate::SetInternalFieldCount()", | 1613 "v8::ObjectTemplate::SetInternalFieldCount()", |
1610 "Invalid internal field count")) { | 1614 "Invalid internal field count")) { |
1611 return; | 1615 return; |
1612 } | 1616 } |
1613 ENTER_V8(isolate); | 1617 ENTER_V8(isolate); |
1614 if (value > 0) { | 1618 if (value > 0) { |
1615 // The internal field count is set by the constructor function's | 1619 // The internal field count is set by the constructor function's |
1616 // construct code, so we ensure that there is a constructor | 1620 // construct code, so we ensure that there is a constructor |
1617 // function to do the setting. | 1621 // function to do the setting. |
1618 EnsureConstructor(this); | 1622 EnsureConstructor(isolate, this); |
1619 } | 1623 } |
1620 Utils::OpenHandle(this)->set_internal_field_count(i::Smi::FromInt(value)); | 1624 Utils::OpenHandle(this)->set_internal_field_count(i::Smi::FromInt(value)); |
1621 } | 1625 } |
1622 | 1626 |
1623 | 1627 |
1624 // --- S c r i p t D a t a --- | 1628 // --- S c r i p t D a t a --- |
1625 | 1629 |
1626 | 1630 |
1627 ScriptData* ScriptData::PreCompile(v8::Isolate* isolate, | 1631 ScriptData* ScriptData::PreCompile(v8::Isolate* isolate, |
1628 const char* input, | 1632 const char* input, |
(...skipping 3504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5133 | 5137 |
5134 // Enter V8 via an ENTER_V8 scope. | 5138 // Enter V8 via an ENTER_V8 scope. |
5135 { | 5139 { |
5136 ENTER_V8(isolate); | 5140 ENTER_V8(isolate); |
5137 v8::Handle<ObjectTemplate> proxy_template = global_template; | 5141 v8::Handle<ObjectTemplate> proxy_template = global_template; |
5138 i::Handle<i::FunctionTemplateInfo> proxy_constructor; | 5142 i::Handle<i::FunctionTemplateInfo> proxy_constructor; |
5139 i::Handle<i::FunctionTemplateInfo> global_constructor; | 5143 i::Handle<i::FunctionTemplateInfo> global_constructor; |
5140 | 5144 |
5141 if (!global_template.IsEmpty()) { | 5145 if (!global_template.IsEmpty()) { |
5142 // Make sure that the global_template has a constructor. | 5146 // Make sure that the global_template has a constructor. |
5143 global_constructor = EnsureConstructor(*global_template); | 5147 global_constructor = EnsureConstructor(isolate, *global_template); |
5144 | 5148 |
5145 // Create a fresh template for the global proxy object. | 5149 // Create a fresh template for the global proxy object. |
5146 proxy_template = ObjectTemplate::New(); | 5150 proxy_template = ObjectTemplate::New(); |
5147 proxy_constructor = EnsureConstructor(*proxy_template); | 5151 proxy_constructor = EnsureConstructor(isolate, *proxy_template); |
5148 | 5152 |
5149 // Set the global template to be the prototype template of | 5153 // Set the global template to be the prototype template of |
5150 // global proxy template. | 5154 // global proxy template. |
5151 proxy_constructor->set_prototype_template( | 5155 proxy_constructor->set_prototype_template( |
5152 *Utils::OpenHandle(*global_template)); | 5156 *Utils::OpenHandle(*global_template)); |
5153 | 5157 |
5154 // Migrate security handlers from global_template to | 5158 // Migrate security handlers from global_template to |
5155 // proxy_template. Temporarily removing access check | 5159 // proxy_template. Temporarily removing access check |
5156 // information from the global template. | 5160 // information from the global template. |
5157 if (!global_constructor->access_check_info()->IsUndefined()) { | 5161 if (!global_constructor->access_check_info()->IsUndefined()) { |
(...skipping 2353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7511 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7515 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7512 Address callback_address = | 7516 Address callback_address = |
7513 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7517 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7514 VMState<EXTERNAL> state(isolate); | 7518 VMState<EXTERNAL> state(isolate); |
7515 ExternalCallbackScope call_scope(isolate, callback_address); | 7519 ExternalCallbackScope call_scope(isolate, callback_address); |
7516 callback(info); | 7520 callback(info); |
7517 } | 7521 } |
7518 | 7522 |
7519 | 7523 |
7520 } } // namespace v8::internal | 7524 } } // namespace v8::internal |
OLD | NEW |