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

Side by Side Diff: src/factory.cc

Issue 10857030: Add basic support for Latin1 to the API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments. Created 8 years, 4 months 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/heap.h » ('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 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 Handle<String> Factory::NewStringFromAscii(Vector<const char> string, 198 Handle<String> Factory::NewStringFromAscii(Vector<const char> string,
199 PretenureFlag pretenure) { 199 PretenureFlag pretenure) {
200 CALL_HEAP_FUNCTION( 200 CALL_HEAP_FUNCTION(
201 isolate(), 201 isolate(),
202 isolate()->heap()->AllocateStringFromAscii(string, pretenure), 202 isolate()->heap()->AllocateStringFromAscii(string, pretenure),
203 String); 203 String);
204 } 204 }
205 205
206 Handle<String> Factory::NewStringFromUtf8(Vector<const char> string, 206 Handle<String> Factory::NewStringFromUtf8(Vector<const char> string,
207 PretenureFlag pretenure) { 207 PretenureFlag pretenure,
208 String::AsciiHint ascii_hint) {
208 CALL_HEAP_FUNCTION( 209 CALL_HEAP_FUNCTION(
209 isolate(), 210 isolate(),
210 isolate()->heap()->AllocateStringFromUtf8(string, pretenure), 211 isolate()->heap()->AllocateStringFromUtf8(
212 string, pretenure, ascii_hint),
211 String); 213 String);
212 } 214 }
213 215
216
217 Handle<String> Factory::NewStringFromLatin1(Vector<const char> string,
218 PretenureFlag pretenure,
219 String::AsciiHint ascii_hint) {
220 CALL_HEAP_FUNCTION(
221 isolate(),
222 isolate()->heap()->AllocateStringFromLatin1(
223 string, pretenure, ascii_hint),
224 String);
225 }
226
214 227
215 Handle<String> Factory::NewStringFromTwoByte(Vector<const uc16> string, 228 Handle<String> Factory::NewStringFromTwoByte(Vector<const uc16> string,
216 PretenureFlag pretenure) { 229 PretenureFlag pretenure) {
217 CALL_HEAP_FUNCTION( 230 CALL_HEAP_FUNCTION(
218 isolate(), 231 isolate(),
219 isolate()->heap()->AllocateStringFromTwoByte(string, pretenure), 232 isolate()->heap()->AllocateStringFromTwoByte(string, pretenure),
220 String); 233 String);
221 } 234 }
222 235
223 236
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 1413
1401 1414
1402 Handle<Object> Factory::ToBoolean(bool value) { 1415 Handle<Object> Factory::ToBoolean(bool value) {
1403 return Handle<Object>(value 1416 return Handle<Object>(value
1404 ? isolate()->heap()->true_value() 1417 ? isolate()->heap()->true_value()
1405 : isolate()->heap()->false_value()); 1418 : isolate()->heap()->false_value());
1406 } 1419 }
1407 1420
1408 1421
1409 } } // namespace v8::internal 1422 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698