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

Side by Side Diff: src/factory.cc

Issue 143633007: A64: Synchronize with r18764. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/flag-definitions.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 Handle<TypeFeedbackInfo> Factory::NewTypeFeedbackInfo() { 200 Handle<TypeFeedbackInfo> Factory::NewTypeFeedbackInfo() {
201 CALL_HEAP_FUNCTION(isolate(), 201 CALL_HEAP_FUNCTION(isolate(),
202 isolate()->heap()->AllocateTypeFeedbackInfo(), 202 isolate()->heap()->AllocateTypeFeedbackInfo(),
203 TypeFeedbackInfo); 203 TypeFeedbackInfo);
204 } 204 }
205 205
206 206
207 // Internalized strings are created in the old generation (data space). 207 // Internalized strings are created in the old generation (data space).
208 Handle<String> Factory::InternalizeUtf8String(Vector<const char> string) { 208 Handle<String> Factory::InternalizeUtf8String(Vector<const char> string) {
209 CALL_HEAP_FUNCTION(isolate(), 209 Utf8StringKey key(string, isolate()->heap()->HashSeed());
210 isolate()->heap()->InternalizeUtf8String(string), 210 return InternalizeStringWithKey(&key);
211 String);
212 } 211 }
213 212
214 213
215 // Internalized strings are created in the old generation (data space). 214 // Internalized strings are created in the old generation (data space).
216 Handle<String> Factory::InternalizeString(Handle<String> string) { 215 Handle<String> Factory::InternalizeString(Handle<String> string) {
217 CALL_HEAP_FUNCTION(isolate(), 216 CALL_HEAP_FUNCTION(isolate(),
218 isolate()->heap()->InternalizeString(*string), 217 isolate()->heap()->InternalizeString(*string),
219 String); 218 String);
220 } 219 }
221 220
222 221
223 Handle<String> Factory::InternalizeOneByteString(Vector<const uint8_t> string) { 222 Handle<String> Factory::InternalizeOneByteString(Vector<const uint8_t> string) {
224 CALL_HEAP_FUNCTION(isolate(), 223 OneByteStringKey key(string, isolate()->heap()->HashSeed());
225 isolate()->heap()->InternalizeOneByteString(string), 224 return InternalizeStringWithKey(&key);
226 String);
227 } 225 }
228 226
229 227
230 Handle<String> Factory::InternalizeOneByteString( 228 Handle<String> Factory::InternalizeOneByteString(
231 Handle<SeqOneByteString> string, int from, int length) { 229 Handle<SeqOneByteString> string, int from, int length) {
232 CALL_HEAP_FUNCTION(isolate(), 230 SubStringOneByteStringKey key(string, from, length);
233 isolate()->heap()->InternalizeOneByteString( 231 return InternalizeStringWithKey(&key);
234 string, from, length),
235 String);
236 } 232 }
237 233
238 234
239 Handle<String> Factory::InternalizeTwoByteString(Vector<const uc16> string) { 235 Handle<String> Factory::InternalizeTwoByteString(Vector<const uc16> string) {
236 TwoByteStringKey key(string, isolate()->heap()->HashSeed());
237 return InternalizeStringWithKey(&key);
238 }
239
240
241 template<class StringTableKey>
242 Handle<String> Factory::InternalizeStringWithKey(StringTableKey* key) {
240 CALL_HEAP_FUNCTION(isolate(), 243 CALL_HEAP_FUNCTION(isolate(),
241 isolate()->heap()->InternalizeTwoByteString(string), 244 isolate()->heap()->InternalizeStringWithKey(key),
242 String); 245 String);
243 } 246 }
244 247
245 248
246 Handle<String> Factory::NewStringFromOneByte(Vector<const uint8_t> string, 249 Handle<String> Factory::NewStringFromOneByte(Vector<const uint8_t> string,
247 PretenureFlag pretenure) { 250 PretenureFlag pretenure) {
248 CALL_HEAP_FUNCTION( 251 CALL_HEAP_FUNCTION(
249 isolate(), 252 isolate(),
250 isolate()->heap()->AllocateStringFromOneByte(string, pretenure), 253 isolate()->heap()->AllocateStringFromOneByte(string, pretenure),
251 String); 254 String);
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 isolate(), 725 isolate(),
723 isolate()->heap()->AllocateByteArray(length, pretenure), 726 isolate()->heap()->AllocateByteArray(length, pretenure),
724 ByteArray); 727 ByteArray);
725 } 728 }
726 729
727 730
728 Handle<ExternalArray> Factory::NewExternalArray(int length, 731 Handle<ExternalArray> Factory::NewExternalArray(int length,
729 ExternalArrayType array_type, 732 ExternalArrayType array_type,
730 void* external_pointer, 733 void* external_pointer,
731 PretenureFlag pretenure) { 734 PretenureFlag pretenure) {
732 ASSERT(0 <= length); 735 ASSERT(0 <= length && length <= Smi::kMaxValue);
733 CALL_HEAP_FUNCTION( 736 CALL_HEAP_FUNCTION(
734 isolate(), 737 isolate(),
735 isolate()->heap()->AllocateExternalArray(length, 738 isolate()->heap()->AllocateExternalArray(length,
736 array_type, 739 array_type,
737 external_pointer, 740 external_pointer,
738 pretenure), 741 pretenure),
739 ExternalArray); 742 ExternalArray);
740 } 743 }
741 744
742 745
746 Handle<FixedTypedArrayBase> Factory::NewFixedTypedArray(
747 int length,
748 ExternalArrayType array_type,
749 PretenureFlag pretenure) {
750 ASSERT(0 <= length && length <= Smi::kMaxValue);
751 CALL_HEAP_FUNCTION(
752 isolate(),
753 isolate()->heap()->AllocateFixedTypedArray(length,
754 array_type,
755 pretenure),
756 FixedTypedArrayBase);
757 }
758
759
743 Handle<Cell> Factory::NewCell(Handle<Object> value) { 760 Handle<Cell> Factory::NewCell(Handle<Object> value) {
744 AllowDeferredHandleDereference convert_to_cell; 761 AllowDeferredHandleDereference convert_to_cell;
745 CALL_HEAP_FUNCTION( 762 CALL_HEAP_FUNCTION(
746 isolate(), 763 isolate(),
747 isolate()->heap()->AllocateCell(*value), 764 isolate()->heap()->AllocateCell(*value),
748 Cell); 765 Cell);
749 } 766 }
750 767
751 768
752 Handle<PropertyCell> Factory::NewPropertyCellWithHole() { 769 Handle<PropertyCell> Factory::NewPropertyCellWithHole() {
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1993 return Handle<Object>::null(); 2010 return Handle<Object>::null();
1994 } 2011 }
1995 2012
1996 2013
1997 Handle<Object> Factory::ToBoolean(bool value) { 2014 Handle<Object> Factory::ToBoolean(bool value) {
1998 return value ? true_value() : false_value(); 2015 return value ? true_value() : false_value();
1999 } 2016 }
2000 2017
2001 2018
2002 } } // namespace v8::internal 2019 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698