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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 } | 879 } |
880 | 880 |
881 | 881 |
882 Handle<Code> Factory::CopyCode(Handle<Code> code, Vector<byte> reloc_info) { | 882 Handle<Code> Factory::CopyCode(Handle<Code> code, Vector<byte> reloc_info) { |
883 CALL_HEAP_FUNCTION(isolate(), | 883 CALL_HEAP_FUNCTION(isolate(), |
884 isolate()->heap()->CopyCode(*code, reloc_info), | 884 isolate()->heap()->CopyCode(*code, reloc_info), |
885 Code); | 885 Code); |
886 } | 886 } |
887 | 887 |
888 | 888 |
889 MUST_USE_RESULT static inline MaybeObject* DoCopyAdd( | |
890 DescriptorArray* array, | |
891 String* key, | |
892 Object* value, | |
893 PropertyAttributes attributes) { | |
894 CallbacksDescriptor desc(key, value, attributes); | |
895 MaybeObject* obj = array->CopyAdd(&desc); | |
896 return obj; | |
897 } | |
898 | |
899 | |
900 // Allocate the new array. | |
901 Handle<DescriptorArray> Factory::CopyAppendForeignDescriptor( | |
902 Handle<DescriptorArray> array, | |
903 Handle<String> key, | |
904 Handle<Object> value, | |
905 PropertyAttributes attributes) { | |
906 CALL_HEAP_FUNCTION(isolate(), | |
907 DoCopyAdd(*array, *key, *value, attributes), | |
908 DescriptorArray); | |
909 } | |
910 | |
911 | |
912 Handle<String> Factory::SymbolFromString(Handle<String> value) { | 889 Handle<String> Factory::SymbolFromString(Handle<String> value) { |
913 CALL_HEAP_FUNCTION(isolate(), | 890 CALL_HEAP_FUNCTION(isolate(), |
914 isolate()->heap()->LookupSymbol(*value), String); | 891 isolate()->heap()->LookupSymbol(*value), String); |
915 } | 892 } |
916 | 893 |
917 | 894 |
918 Handle<DescriptorArray> Factory::CopyAppendCallbackDescriptors( | 895 Handle<DescriptorArray> Factory::CopyAppendCallbackDescriptors( |
919 Handle<DescriptorArray> array, | 896 Handle<DescriptorArray> array, |
920 Handle<Object> descriptors) { | 897 Handle<Object> descriptors) { |
921 v8::NeanderArray callbacks(descriptors); | 898 v8::NeanderArray callbacks(descriptors); |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1490 | 1467 |
1491 | 1468 |
1492 Handle<Object> Factory::ToBoolean(bool value) { | 1469 Handle<Object> Factory::ToBoolean(bool value) { |
1493 return Handle<Object>(value | 1470 return Handle<Object>(value |
1494 ? isolate()->heap()->true_value() | 1471 ? isolate()->heap()->true_value() |
1495 : isolate()->heap()->false_value()); | 1472 : isolate()->heap()->false_value()); |
1496 } | 1473 } |
1497 | 1474 |
1498 | 1475 |
1499 } } // namespace v8::internal | 1476 } } // namespace v8::internal |
OLD | NEW |