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 757 matching lines...) Loading... |
768 // Set up the code pointer in both the shared function info and in | 768 // Set up the code pointer in both the shared function info and in |
769 // the function itself. | 769 // the function itself. |
770 function->shared()->set_code(*code); | 770 function->shared()->set_code(*code); |
771 function->set_code(*code); | 771 function->set_code(*code); |
772 | 772 |
773 if (force_initial_map || | 773 if (force_initial_map || |
774 type != JS_OBJECT_TYPE || | 774 type != JS_OBJECT_TYPE || |
775 instance_size != JSObject::kHeaderSize) { | 775 instance_size != JSObject::kHeaderSize) { |
776 Handle<Map> initial_map = NewMap(type, | 776 Handle<Map> initial_map = NewMap(type, |
777 instance_size, | 777 instance_size, |
778 FAST_SMI_ONLY_ELEMENTS); | 778 GetInitialFastElementsKind()); |
779 function->set_initial_map(*initial_map); | 779 function->set_initial_map(*initial_map); |
780 initial_map->set_constructor(*function); | 780 initial_map->set_constructor(*function); |
781 } | 781 } |
782 | 782 |
783 // Set function.prototype and give the prototype a constructor | 783 // Set function.prototype and give the prototype a constructor |
784 // property that refers to the function. | 784 // property that refers to the function. |
785 SetPrototypeProperty(function, prototype); | 785 SetPrototypeProperty(function, prototype); |
786 // Currently safe because it is only invoked from Genesis. | 786 // Currently safe because it is only invoked from Genesis. |
787 CHECK_NOT_EMPTY_HANDLE(isolate(), | 787 CHECK_NOT_EMPTY_HANDLE(isolate(), |
788 JSObject::SetLocalPropertyIgnoreAttributes( | 788 JSObject::SetLocalPropertyIgnoreAttributes( |
(...skipping 217 matching lines...) Loading... |
1006 | 1006 |
1007 void Factory::EnsureCanContainHeapObjectElements(Handle<JSArray> array) { | 1007 void Factory::EnsureCanContainHeapObjectElements(Handle<JSArray> array) { |
1008 CALL_HEAP_FUNCTION_VOID( | 1008 CALL_HEAP_FUNCTION_VOID( |
1009 isolate(), | 1009 isolate(), |
1010 array->EnsureCanContainHeapObjectElements()); | 1010 array->EnsureCanContainHeapObjectElements()); |
1011 } | 1011 } |
1012 | 1012 |
1013 | 1013 |
1014 void Factory::EnsureCanContainElements(Handle<JSArray> array, | 1014 void Factory::EnsureCanContainElements(Handle<JSArray> array, |
1015 Handle<FixedArrayBase> elements, | 1015 Handle<FixedArrayBase> elements, |
| 1016 uint32_t length, |
1016 EnsureElementsMode mode) { | 1017 EnsureElementsMode mode) { |
1017 CALL_HEAP_FUNCTION_VOID( | 1018 CALL_HEAP_FUNCTION_VOID( |
1018 isolate(), | 1019 isolate(), |
1019 array->EnsureCanContainElements(*elements, mode)); | 1020 array->EnsureCanContainElements(*elements, length, mode)); |
1020 } | 1021 } |
1021 | 1022 |
1022 | 1023 |
1023 Handle<JSProxy> Factory::NewJSProxy(Handle<Object> handler, | 1024 Handle<JSProxy> Factory::NewJSProxy(Handle<Object> handler, |
1024 Handle<Object> prototype) { | 1025 Handle<Object> prototype) { |
1025 CALL_HEAP_FUNCTION( | 1026 CALL_HEAP_FUNCTION( |
1026 isolate(), | 1027 isolate(), |
1027 isolate()->heap()->AllocateJSProxy(*handler, *prototype), | 1028 isolate()->heap()->AllocateJSProxy(*handler, *prototype), |
1028 JSProxy); | 1029 JSProxy); |
1029 } | 1030 } |
(...skipping 410 matching lines...) Loading... |
1440 | 1441 |
1441 | 1442 |
1442 Handle<Object> Factory::ToBoolean(bool value) { | 1443 Handle<Object> Factory::ToBoolean(bool value) { |
1443 return Handle<Object>(value | 1444 return Handle<Object>(value |
1444 ? isolate()->heap()->true_value() | 1445 ? isolate()->heap()->true_value() |
1445 : isolate()->heap()->false_value()); | 1446 : isolate()->heap()->false_value()); |
1446 } | 1447 } |
1447 | 1448 |
1448 | 1449 |
1449 } } // namespace v8::internal | 1450 } } // namespace v8::internal |
OLD | NEW |