OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 | 86 |
87 Handle<String> Factory::NewRawTwoByteString(int length, | 87 Handle<String> Factory::NewRawTwoByteString(int length, |
88 PretenureFlag pretenure) { | 88 PretenureFlag pretenure) { |
89 CALL_HEAP_FUNCTION(Heap::AllocateRawTwoByteString(length, pretenure), String); | 89 CALL_HEAP_FUNCTION(Heap::AllocateRawTwoByteString(length, pretenure), String); |
90 } | 90 } |
91 | 91 |
92 | 92 |
93 Handle<String> Factory::NewConsString(Handle<String> first, | 93 Handle<String> Factory::NewConsString(Handle<String> first, |
94 Handle<String> second) { | 94 Handle<String> second) { |
95 if (first->length() == 0) return second; | |
96 if (second->length() == 0) return first; | |
97 CALL_HEAP_FUNCTION(Heap::AllocateConsString(*first, *second), String); | 95 CALL_HEAP_FUNCTION(Heap::AllocateConsString(*first, *second), String); |
98 } | 96 } |
99 | 97 |
100 | 98 |
101 Handle<String> Factory::NewStringSlice(Handle<String> str, | 99 Handle<String> Factory::NewStringSlice(Handle<String> str, |
102 int begin, | 100 int begin, |
103 int end) { | 101 int end) { |
104 CALL_HEAP_FUNCTION(str->Slice(begin, end), String); | 102 CALL_HEAP_FUNCTION(str->Slice(begin, end), String); |
105 } | 103 } |
106 | 104 |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 Execution::ConfigureInstance(instance, | 902 Execution::ConfigureInstance(instance, |
905 instance_template, | 903 instance_template, |
906 pending_exception); | 904 pending_exception); |
907 } else { | 905 } else { |
908 *pending_exception = false; | 906 *pending_exception = false; |
909 } | 907 } |
910 } | 908 } |
911 | 909 |
912 | 910 |
913 } } // namespace v8::internal | 911 } } // namespace v8::internal |
OLD | NEW |