Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: src/factory.cc

Issue 9038: Create an abstraction for the string type flags so that they can be cached.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 85
86 Handle<String> Factory::NewRawTwoByteString(int length, 86 Handle<String> Factory::NewRawTwoByteString(int length,
87 PretenureFlag pretenure) { 87 PretenureFlag pretenure) {
88 CALL_HEAP_FUNCTION(Heap::AllocateRawTwoByteString(length, pretenure), String); 88 CALL_HEAP_FUNCTION(Heap::AllocateRawTwoByteString(length, pretenure), String);
89 } 89 }
90 90
91 91
92 Handle<String> Factory::NewConsString(Handle<String> first, 92 Handle<String> Factory::NewConsString(Handle<String> first,
93 Handle<String> second) { 93 StringShape first_shape,
94 if (first->length() == 0) return second; 94 Handle<String> second,
95 if (second->length() == 0) return first; 95 StringShape second_shape) {
96 CALL_HEAP_FUNCTION(Heap::AllocateConsString(*first, *second), String); 96 if (first->length(first_shape) == 0) return second;
97 if (second->length(second_shape) == 0) return first;
98 CALL_HEAP_FUNCTION(Heap::AllocateConsString(*first,
99 first_shape,
100 *second,
101 second_shape), String);
Mads Ager (chromium) 2008/11/03 08:45:49 Put String on a new line aligned with Heap?
97 } 102 }
98 103
99 104
100 Handle<String> Factory::NewStringSlice(Handle<String> str, int begin, int end) { 105 Handle<String> Factory::NewStringSlice(Handle<String> str,
101 CALL_HEAP_FUNCTION(str->Slice(begin, end), String); 106 StringShape shape,
107 int begin,
108 int end) {
109 CALL_HEAP_FUNCTION(str->Slice(shape, begin, end), String);
102 } 110 }
103 111
104 112
105 Handle<String> Factory::NewExternalStringFromAscii( 113 Handle<String> Factory::NewExternalStringFromAscii(
106 ExternalAsciiString::Resource* resource) { 114 ExternalAsciiString::Resource* resource) {
107 CALL_HEAP_FUNCTION(Heap::AllocateExternalStringFromAscii(resource), String); 115 CALL_HEAP_FUNCTION(Heap::AllocateExternalStringFromAscii(resource), String);
108 } 116 }
109 117
110 118
111 Handle<String> Factory::NewExternalStringFromTwoByte( 119 Handle<String> Factory::NewExternalStringFromTwoByte(
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 Execution::ConfigureInstance(instance, 837 Execution::ConfigureInstance(instance,
830 instance_template, 838 instance_template,
831 pending_exception); 839 pending_exception);
832 } else { 840 } else {
833 *pending_exception = false; 841 *pending_exception = false;
834 } 842 }
835 } 843 }
836 844
837 845
838 } } // namespace v8::internal 846 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698