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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 | 73 |
74 Handle<String> Factory::NewRawTwoByteString(int length, | 74 Handle<String> Factory::NewRawTwoByteString(int length, |
75 PretenureFlag pretenure) { | 75 PretenureFlag pretenure) { |
76 CALL_HEAP_FUNCTION(Heap::AllocateRawTwoByteString(length, pretenure), String); | 76 CALL_HEAP_FUNCTION(Heap::AllocateRawTwoByteString(length, pretenure), String); |
77 } | 77 } |
78 | 78 |
79 | 79 |
80 Handle<String> Factory::NewConsString(Handle<String> first, | 80 Handle<String> Factory::NewConsString(Handle<String> first, |
81 Handle<String> second) { | 81 Handle<String> second) { |
| 82 if (first->length() == 0) return second; |
| 83 if (second->length() == 0) return first; |
82 CALL_HEAP_FUNCTION(Heap::AllocateConsString(*first, *second), String); | 84 CALL_HEAP_FUNCTION(Heap::AllocateConsString(*first, *second), String); |
83 } | 85 } |
84 | 86 |
85 | 87 |
86 Handle<String> Factory::NewStringSlice(Handle<String> str, int begin, int end) { | 88 Handle<String> Factory::NewStringSlice(Handle<String> str, int begin, int end) { |
87 CALL_HEAP_FUNCTION(str->Slice(begin, end), String); | 89 CALL_HEAP_FUNCTION(str->Slice(begin, end), String); |
88 } | 90 } |
89 | 91 |
90 | 92 |
91 Handle<String> Factory::NewExternalStringFromAscii( | 93 Handle<String> Factory::NewExternalStringFromAscii( |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 Execution::ConfigureInstance(instance, | 808 Execution::ConfigureInstance(instance, |
807 instance_template, | 809 instance_template, |
808 pending_exception); | 810 pending_exception); |
809 } else { | 811 } else { |
810 *pending_exception = false; | 812 *pending_exception = false; |
811 } | 813 } |
812 } | 814 } |
813 | 815 |
814 | 816 |
815 } } // namespace v8::internal | 817 } } // namespace v8::internal |
OLD | NEW |