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

Side by Side Diff: src/factory.cc

Issue 9408: Removed some unsafe uses of StringShape.... (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
« no previous file with comments | « src/factory.h ('k') | src/handles.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 StringShape first_shape, 93 StringShape first_shape,
94 Handle<String> second, 94 Handle<String> second,
95 StringShape second_shape) { 95 StringShape second_shape) {
96 if (first->length(first_shape) == 0) return second; 96 if (first->length(first_shape) == 0) return second;
97 if (second->length(second_shape) == 0) return first; 97 if (second->length(second_shape) == 0) return first;
98 CALL_HEAP_FUNCTION(Heap::AllocateConsString(*first, 98 CALL_HEAP_FUNCTION(Heap::AllocateConsString(*first, *second), String);
99 first_shape,
100 *second,
101 second_shape),
102 String);
103 } 99 }
104 100
105 101
106 Handle<String> Factory::NewStringSlice(Handle<String> str, 102 Handle<String> Factory::NewStringSlice(Handle<String> str,
107 StringShape shape,
108 int begin, 103 int begin,
109 int end) { 104 int end) {
110 CALL_HEAP_FUNCTION(str->Slice(shape, begin, end), String); 105 CALL_HEAP_FUNCTION(str->Slice(begin, end), String);
111 } 106 }
112 107
113 108
114 Handle<String> Factory::NewExternalStringFromAscii( 109 Handle<String> Factory::NewExternalStringFromAscii(
115 ExternalAsciiString::Resource* resource) { 110 ExternalAsciiString::Resource* resource) {
116 CALL_HEAP_FUNCTION(Heap::AllocateExternalStringFromAscii(resource), String); 111 CALL_HEAP_FUNCTION(Heap::AllocateExternalStringFromAscii(resource), String);
117 } 112 }
118 113
119 114
120 Handle<String> Factory::NewExternalStringFromTwoByte( 115 Handle<String> Factory::NewExternalStringFromTwoByte(
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 Execution::ConfigureInstance(instance, 833 Execution::ConfigureInstance(instance,
839 instance_template, 834 instance_template,
840 pending_exception); 835 pending_exception);
841 } else { 836 } else {
842 *pending_exception = false; 837 *pending_exception = false;
843 } 838 }
844 } 839 }
845 840
846 841
847 } } // namespace v8::internal 842 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698