| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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-natives.h" | 5 #include "src/api-natives.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
| 9 #include "src/lookup.h" | 9 #include "src/lookup.h" |
| 10 #include "src/messages.h" | 10 #include "src/messages.h" |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 | 543 |
| 544 Handle<JSObject> object = isolate->factory()->NewJSObject(object_function); | 544 Handle<JSObject> object = isolate->factory()->NewJSObject(object_function); |
| 545 JSObject::ForceSetPrototype(object, isolate->factory()->null_value()); | 545 JSObject::ForceSetPrototype(object, isolate->factory()->null_value()); |
| 546 | 546 |
| 547 return object; | 547 return object; |
| 548 } | 548 } |
| 549 | 549 |
| 550 void ApiNatives::AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info, | 550 void ApiNatives::AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info, |
| 551 Handle<Name> name, Handle<Object> value, | 551 Handle<Name> name, Handle<Object> value, |
| 552 PropertyAttributes attributes) { | 552 PropertyAttributes attributes) { |
| 553 PropertyDetails details(attributes, DATA, 0, PropertyCellType::kNoCell); | 553 PropertyDetails details(kData, attributes, 0, PropertyCellType::kNoCell); |
| 554 auto details_handle = handle(details.AsSmi(), isolate); | 554 auto details_handle = handle(details.AsSmi(), isolate); |
| 555 Handle<Object> data[] = {name, details_handle, value}; | 555 Handle<Object> data[] = {name, details_handle, value}; |
| 556 AddPropertyToPropertyList(isolate, info, arraysize(data), data); | 556 AddPropertyToPropertyList(isolate, info, arraysize(data), data); |
| 557 } | 557 } |
| 558 | 558 |
| 559 | 559 |
| 560 void ApiNatives::AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info, | 560 void ApiNatives::AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info, |
| 561 Handle<Name> name, v8::Intrinsic intrinsic, | 561 Handle<Name> name, v8::Intrinsic intrinsic, |
| 562 PropertyAttributes attributes) { | 562 PropertyAttributes attributes) { |
| 563 auto value = handle(Smi::FromInt(intrinsic), isolate); | 563 auto value = handle(Smi::FromInt(intrinsic), isolate); |
| 564 auto intrinsic_marker = isolate->factory()->true_value(); | 564 auto intrinsic_marker = isolate->factory()->true_value(); |
| 565 PropertyDetails details(attributes, DATA, 0, PropertyCellType::kNoCell); | 565 PropertyDetails details(kData, attributes, 0, PropertyCellType::kNoCell); |
| 566 auto details_handle = handle(details.AsSmi(), isolate); | 566 auto details_handle = handle(details.AsSmi(), isolate); |
| 567 Handle<Object> data[] = {name, intrinsic_marker, details_handle, value}; | 567 Handle<Object> data[] = {name, intrinsic_marker, details_handle, value}; |
| 568 AddPropertyToPropertyList(isolate, info, arraysize(data), data); | 568 AddPropertyToPropertyList(isolate, info, arraysize(data), data); |
| 569 } | 569 } |
| 570 | 570 |
| 571 | 571 |
| 572 void ApiNatives::AddAccessorProperty(Isolate* isolate, | 572 void ApiNatives::AddAccessorProperty(Isolate* isolate, |
| 573 Handle<TemplateInfo> info, | 573 Handle<TemplateInfo> info, |
| 574 Handle<Name> name, | 574 Handle<Name> name, |
| 575 Handle<FunctionTemplateInfo> getter, | 575 Handle<FunctionTemplateInfo> getter, |
| 576 Handle<FunctionTemplateInfo> setter, | 576 Handle<FunctionTemplateInfo> setter, |
| 577 PropertyAttributes attributes) { | 577 PropertyAttributes attributes) { |
| 578 PropertyDetails details(attributes, ACCESSOR, 0, PropertyCellType::kNoCell); | 578 PropertyDetails details(kAccessor, attributes, 0, PropertyCellType::kNoCell); |
| 579 auto details_handle = handle(details.AsSmi(), isolate); | 579 auto details_handle = handle(details.AsSmi(), isolate); |
| 580 Handle<Object> data[] = {name, details_handle, getter, setter}; | 580 Handle<Object> data[] = {name, details_handle, getter, setter}; |
| 581 AddPropertyToPropertyList(isolate, info, arraysize(data), data); | 581 AddPropertyToPropertyList(isolate, info, arraysize(data), data); |
| 582 } | 582 } |
| 583 | 583 |
| 584 | 584 |
| 585 void ApiNatives::AddNativeDataProperty(Isolate* isolate, | 585 void ApiNatives::AddNativeDataProperty(Isolate* isolate, |
| 586 Handle<TemplateInfo> info, | 586 Handle<TemplateInfo> info, |
| 587 Handle<AccessorInfo> property) { | 587 Handle<AccessorInfo> property) { |
| 588 Object* maybe_list = info->property_accessors(); | 588 Object* maybe_list = info->property_accessors(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 map->set_is_constructor(true); | 703 map->set_is_constructor(true); |
| 704 } | 704 } |
| 705 | 705 |
| 706 if (immutable_proto) map->set_immutable_proto(true); | 706 if (immutable_proto) map->set_immutable_proto(true); |
| 707 | 707 |
| 708 return result; | 708 return result; |
| 709 } | 709 } |
| 710 | 710 |
| 711 } // namespace internal | 711 } // namespace internal |
| 712 } // namespace v8 | 712 } // namespace v8 |
| OLD | NEW |