| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "factory.h" | 5 #include "factory.h" |
| 6 | 6 |
| 7 #include "macro-assembler.h" | 7 #include "macro-assembler.h" |
| 8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
| 9 #include "v8conversions.h" | 9 #include "v8conversions.h" |
| 10 | 10 |
| (...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1489 // The global object might be created from an object template with accessors. | 1489 // The global object might be created from an object template with accessors. |
| 1490 // Fill these accessors into the dictionary. | 1490 // Fill these accessors into the dictionary. |
| 1491 Handle<DescriptorArray> descs(map->instance_descriptors()); | 1491 Handle<DescriptorArray> descs(map->instance_descriptors()); |
| 1492 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) { | 1492 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) { |
| 1493 PropertyDetails details = descs->GetDetails(i); | 1493 PropertyDetails details = descs->GetDetails(i); |
| 1494 ASSERT(details.type() == CALLBACKS); // Only accessors are expected. | 1494 ASSERT(details.type() == CALLBACKS); // Only accessors are expected. |
| 1495 PropertyDetails d = PropertyDetails(details.attributes(), CALLBACKS, i + 1); | 1495 PropertyDetails d = PropertyDetails(details.attributes(), CALLBACKS, i + 1); |
| 1496 Handle<Name> name(descs->GetKey(i)); | 1496 Handle<Name> name(descs->GetKey(i)); |
| 1497 Handle<Object> value(descs->GetCallbacksObject(i), isolate()); | 1497 Handle<Object> value(descs->GetCallbacksObject(i), isolate()); |
| 1498 Handle<PropertyCell> cell = NewPropertyCell(value); | 1498 Handle<PropertyCell> cell = NewPropertyCell(value); |
| 1499 NameDictionary::AddNameEntry(dictionary, name, cell, d); | 1499 NameDictionary::Add(dictionary, *name, cell, d); |
| 1500 } | 1500 } |
| 1501 | 1501 |
| 1502 // Allocate the global object and initialize it with the backing store. | 1502 // Allocate the global object and initialize it with the backing store. |
| 1503 Handle<GlobalObject> global = New<GlobalObject>(map, OLD_POINTER_SPACE); | 1503 Handle<GlobalObject> global = New<GlobalObject>(map, OLD_POINTER_SPACE); |
| 1504 isolate()->heap()->InitializeJSObjectFromMap(*global, *dictionary, *map); | 1504 isolate()->heap()->InitializeJSObjectFromMap(*global, *dictionary, *map); |
| 1505 | 1505 |
| 1506 // Create a new map for the global object. | 1506 // Create a new map for the global object. |
| 1507 Handle<Map> new_map = Map::CopyDropDescriptors(map); | 1507 Handle<Map> new_map = Map::CopyDropDescriptors(map); |
| 1508 new_map->set_dictionary_map(true); | 1508 new_map->set_dictionary_map(true); |
| 1509 | 1509 |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2321 return Handle<Object>::null(); | 2321 return Handle<Object>::null(); |
| 2322 } | 2322 } |
| 2323 | 2323 |
| 2324 | 2324 |
| 2325 Handle<Object> Factory::ToBoolean(bool value) { | 2325 Handle<Object> Factory::ToBoolean(bool value) { |
| 2326 return value ? true_value() : false_value(); | 2326 return value ? true_value() : false_value(); |
| 2327 } | 2327 } |
| 2328 | 2328 |
| 2329 | 2329 |
| 2330 } } // namespace v8::internal | 2330 } } // namespace v8::internal |
| OLD | NEW |