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

Side by Side Diff: src/objects.h

Issue 256993003: Remove some remnants of MaybeObjects in objects.*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment Created 6 years, 7 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/mips/lithium-codegen-mips.cc ('k') | src/objects.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 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 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 inline static Handle<Object> NewStorageFor(Isolate* isolate, 1495 inline static Handle<Object> NewStorageFor(Isolate* isolate,
1496 Handle<Object> object, 1496 Handle<Object> object,
1497 Representation representation); 1497 Representation representation);
1498 1498
1499 // Returns true if the object is of the correct type to be used as a 1499 // Returns true if the object is of the correct type to be used as a
1500 // implementation of a JSObject's elements. 1500 // implementation of a JSObject's elements.
1501 inline bool HasValidElements(); 1501 inline bool HasValidElements();
1502 1502
1503 inline bool HasSpecificClassOf(String* name); 1503 inline bool HasSpecificClassOf(String* name);
1504 1504
1505 MUST_USE_RESULT MaybeObject* ToObject(Isolate* isolate); // ECMA-262 9.9.
1506 bool BooleanValue(); // ECMA-262 9.2. 1505 bool BooleanValue(); // ECMA-262 9.2.
1507 1506
1508 // Convert to a JSObject if needed. 1507 // Convert to a JSObject if needed.
1509 // native_context is used when creating wrapper object. 1508 // native_context is used when creating wrapper object.
1510 static inline MaybeHandle<JSReceiver> ToObject(Isolate* isolate, 1509 static inline MaybeHandle<JSReceiver> ToObject(Isolate* isolate,
1511 Handle<Object> object); 1510 Handle<Object> object);
1512 static MaybeHandle<JSReceiver> ToObject(Isolate* isolate, 1511 static MaybeHandle<JSReceiver> ToObject(Isolate* isolate,
1513 Handle<Object> object, 1512 Handle<Object> object,
1514 Handle<Context> context); 1513 Handle<Context> context);
1515 1514
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
2218 inline bool HasFixedFloat32Elements(); 2217 inline bool HasFixedFloat32Elements();
2219 inline bool HasFixedFloat64Elements(); 2218 inline bool HasFixedFloat64Elements();
2220 2219
2221 bool HasFastArgumentsElements(); 2220 bool HasFastArgumentsElements();
2222 bool HasDictionaryArgumentsElements(); 2221 bool HasDictionaryArgumentsElements();
2223 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. 2222 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements.
2224 2223
2225 // Requires: HasFastElements(). 2224 // Requires: HasFastElements().
2226 static Handle<FixedArray> EnsureWritableFastElements( 2225 static Handle<FixedArray> EnsureWritableFastElements(
2227 Handle<JSObject> object); 2226 Handle<JSObject> object);
2228 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements();
2229 2227
2230 // Collects elements starting at index 0. 2228 // Collects elements starting at index 0.
2231 // Undefined values are placed after non-undefined values. 2229 // Undefined values are placed after non-undefined values.
2232 // Returns the number of non-undefined values. 2230 // Returns the number of non-undefined values.
2233 static Handle<Object> PrepareElementsForSort(Handle<JSObject> object, 2231 static Handle<Object> PrepareElementsForSort(Handle<JSObject> object,
2234 uint32_t limit); 2232 uint32_t limit);
2235 // As PrepareElementsForSort, but only on objects where elements is 2233 // As PrepareElementsForSort, but only on objects where elements is
2236 // a dictionary, and it will stay a dictionary. Collates undefined and 2234 // a dictionary, and it will stay a dictionary. Collates undefined and
2237 // unexisting elements below limit from position zero of the elements. 2235 // unexisting elements below limit from position zero of the elements.
2238 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object, 2236 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object,
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
2502 // store. 2500 // store.
2503 static Handle<FixedArray> SetFastElementsCapacityAndLength( 2501 static Handle<FixedArray> SetFastElementsCapacityAndLength(
2504 Handle<JSObject> object, 2502 Handle<JSObject> object,
2505 int capacity, 2503 int capacity,
2506 int length, 2504 int length,
2507 SetFastElementsCapacitySmiMode smi_mode); 2505 SetFastElementsCapacitySmiMode smi_mode);
2508 static void SetFastDoubleElementsCapacityAndLength( 2506 static void SetFastDoubleElementsCapacityAndLength(
2509 Handle<JSObject> object, 2507 Handle<JSObject> object,
2510 int capacity, 2508 int capacity,
2511 int length); 2509 int length);
2512 MUST_USE_RESULT MaybeObject* SetFastDoubleElementsCapacityAndLength(
2513 int capacity,
2514 int length);
2515 2510
2516 // Lookup interceptors are used for handling properties controlled by host 2511 // Lookup interceptors are used for handling properties controlled by host
2517 // objects. 2512 // objects.
2518 inline bool HasNamedInterceptor(); 2513 inline bool HasNamedInterceptor();
2519 inline bool HasIndexedInterceptor(); 2514 inline bool HasIndexedInterceptor();
2520 2515
2521 // Computes the enumerable keys from interceptors. Used for debug mirrors and 2516 // Computes the enumerable keys from interceptors. Used for debug mirrors and
2522 // by JSReceiver::GetKeys. 2517 // by JSReceiver::GetKeys.
2523 MUST_USE_RESULT static MaybeHandle<JSObject> GetKeysForNamedInterceptor( 2518 MUST_USE_RESULT static MaybeHandle<JSObject> GetKeysForNamedInterceptor(
2524 Handle<JSObject> object, 2519 Handle<JSObject> object,
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
3058 inline bool ContainsOnlySmisOrHoles(); 3053 inline bool ContainsOnlySmisOrHoles();
3059 3054
3060 // Gives access to raw memory which stores the array's data. 3055 // Gives access to raw memory which stores the array's data.
3061 inline Object** data_start(); 3056 inline Object** data_start();
3062 3057
3063 inline void FillWithHoles(int from, int to); 3058 inline void FillWithHoles(int from, int to);
3064 3059
3065 // Shrink length and insert filler objects. 3060 // Shrink length and insert filler objects.
3066 void Shrink(int length); 3061 void Shrink(int length);
3067 3062
3068 // Copy operations. 3063 // Copy operation.
3069 MUST_USE_RESULT inline MaybeObject* Copy();
3070 MUST_USE_RESULT MaybeObject* CopySize(int new_length,
3071 PretenureFlag pretenure = NOT_TENURED);
3072 static Handle<FixedArray> CopySize(Handle<FixedArray> array, 3064 static Handle<FixedArray> CopySize(Handle<FixedArray> array,
3073 int new_length, 3065 int new_length,
3074 PretenureFlag pretenure = NOT_TENURED); 3066 PretenureFlag pretenure = NOT_TENURED);
3075 3067
3076 // Add the elements of a JSArray to this FixedArray. 3068 // Add the elements of a JSArray to this FixedArray.
3077 MUST_USE_RESULT static MaybeHandle<FixedArray> AddKeysFromArrayLike( 3069 MUST_USE_RESULT static MaybeHandle<FixedArray> AddKeysFromArrayLike(
3078 Handle<FixedArray> content, 3070 Handle<FixedArray> content,
3079 Handle<JSObject> array); 3071 Handle<JSObject> array);
3080 3072
3081 // Computes the union of keys and return the result. 3073 // Computes the union of keys and return the result.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
3160 // Setter and getter for elements. 3152 // Setter and getter for elements.
3161 inline double get_scalar(int index); 3153 inline double get_scalar(int index);
3162 inline int64_t get_representation(int index); 3154 inline int64_t get_representation(int index);
3163 static inline Handle<Object> get(Handle<FixedDoubleArray> array, int index); 3155 static inline Handle<Object> get(Handle<FixedDoubleArray> array, int index);
3164 inline void set(int index, double value); 3156 inline void set(int index, double value);
3165 inline void set_the_hole(int index); 3157 inline void set_the_hole(int index);
3166 3158
3167 // Checking for the hole. 3159 // Checking for the hole.
3168 inline bool is_the_hole(int index); 3160 inline bool is_the_hole(int index);
3169 3161
3170 // Copy operations
3171 MUST_USE_RESULT inline MaybeObject* Copy();
3172
3173 // Garbage collection support. 3162 // Garbage collection support.
3174 inline static int SizeFor(int length) { 3163 inline static int SizeFor(int length) {
3175 return kHeaderSize + length * kDoubleSize; 3164 return kHeaderSize + length * kDoubleSize;
3176 } 3165 }
3177 3166
3178 // Gives access to raw memory which stores the array's data. 3167 // Gives access to raw memory which stores the array's data.
3179 inline double* data_start(); 3168 inline double* data_start();
3180 3169
3181 inline void FillWithHoles(int from, int to); 3170 inline void FillWithHoles(int from, int to);
3182 3171
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
3252 inline void set(int index, int64_t value); 3241 inline void set(int index, int64_t value);
3253 inline void set(int index, double value); 3242 inline void set(int index, double value);
3254 inline void set(int index, int32_t value); 3243 inline void set(int index, int32_t value);
3255 3244
3256 // Set up initial state. 3245 // Set up initial state.
3257 inline void Init(int number_of_int64_entries, 3246 inline void Init(int number_of_int64_entries,
3258 int number_of_code_ptr_entries, 3247 int number_of_code_ptr_entries,
3259 int number_of_heap_ptr_entries, 3248 int number_of_heap_ptr_entries,
3260 int number_of_int32_entries); 3249 int number_of_int32_entries);
3261 3250
3262 // Copy operations
3263 MUST_USE_RESULT inline MaybeObject* Copy();
3264
3265 // Garbage collection support. 3251 // Garbage collection support.
3266 inline static int SizeFor(int number_of_int64_entries, 3252 inline static int SizeFor(int number_of_int64_entries,
3267 int number_of_code_ptr_entries, 3253 int number_of_code_ptr_entries,
3268 int number_of_heap_ptr_entries, 3254 int number_of_heap_ptr_entries,
3269 int number_of_int32_entries) { 3255 int number_of_int32_entries) {
3270 return RoundUp(OffsetAt(number_of_int64_entries, 3256 return RoundUp(OffsetAt(number_of_int64_entries,
3271 number_of_code_ptr_entries, 3257 number_of_code_ptr_entries,
3272 number_of_heap_ptr_entries, 3258 number_of_heap_ptr_entries,
3273 number_of_int32_entries), 3259 number_of_int32_entries),
3274 kPointerSize); 3260 kPointerSize);
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after
5289 5275
5290 void SetAstId(int i, BailoutId value) { 5276 void SetAstId(int i, BailoutId value) {
5291 SetAstIdRaw(i, Smi::FromInt(value.ToInt())); 5277 SetAstIdRaw(i, Smi::FromInt(value.ToInt()));
5292 } 5278 }
5293 5279
5294 int DeoptCount() { 5280 int DeoptCount() {
5295 return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize; 5281 return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize;
5296 } 5282 }
5297 5283
5298 // Allocates a DeoptimizationInputData. 5284 // Allocates a DeoptimizationInputData.
5299 MUST_USE_RESULT static MaybeObject* Allocate(Isolate* isolate, 5285 static Handle<DeoptimizationInputData> New(Isolate* isolate,
5300 int deopt_entry_count, 5286 int deopt_entry_count,
5301 PretenureFlag pretenure); 5287 PretenureFlag pretenure);
5302 5288
5303 // Casting. 5289 // Casting.
5304 static inline DeoptimizationInputData* cast(Object* obj); 5290 static inline DeoptimizationInputData* cast(Object* obj);
5305 5291
5306 #ifdef ENABLE_DISASSEMBLER 5292 #ifdef ENABLE_DISASSEMBLER
5307 void DeoptimizationInputDataPrint(FILE* out); 5293 void DeoptimizationInputDataPrint(FILE* out);
5308 #endif 5294 #endif
5309 5295
5310 private: 5296 private:
5311 static int IndexForEntry(int i) { 5297 static int IndexForEntry(int i) {
(...skipping 24 matching lines...) Expand all
5336 } 5322 }
5337 5323
5338 Smi* PcAndState(int index) { return Smi::cast(get(1 + index * 2)); } 5324 Smi* PcAndState(int index) { return Smi::cast(get(1 + index * 2)); }
5339 void SetPcAndState(int index, Smi* offset) { set(1 + index * 2, offset); } 5325 void SetPcAndState(int index, Smi* offset) { set(1 + index * 2, offset); }
5340 5326
5341 static int LengthOfFixedArray(int deopt_points) { 5327 static int LengthOfFixedArray(int deopt_points) {
5342 return deopt_points * 2; 5328 return deopt_points * 2;
5343 } 5329 }
5344 5330
5345 // Allocates a DeoptimizationOutputData. 5331 // Allocates a DeoptimizationOutputData.
5346 MUST_USE_RESULT static MaybeObject* Allocate(Isolate* isolate, 5332 static Handle<DeoptimizationOutputData> New(Isolate* isolate,
5347 int number_of_deopt_points, 5333 int number_of_deopt_points,
5348 PretenureFlag pretenure); 5334 PretenureFlag pretenure);
5349 5335
5350 // Casting. 5336 // Casting.
5351 static inline DeoptimizationOutputData* cast(Object* obj); 5337 static inline DeoptimizationOutputData* cast(Object* obj);
5352 5338
5353 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) 5339 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER)
5354 void DeoptimizationOutputDataPrint(FILE* out); 5340 void DeoptimizationOutputDataPrint(FILE* out);
5355 #endif 5341 #endif
5356 }; 5342 };
5357 5343
5358 5344
(...skipping 5874 matching lines...) Expand 10 before | Expand all | Expand 10 after
11233 } else { 11219 } else {
11234 value &= ~(1 << bit_position); 11220 value &= ~(1 << bit_position);
11235 } 11221 }
11236 return value; 11222 return value;
11237 } 11223 }
11238 }; 11224 };
11239 11225
11240 } } // namespace v8::internal 11226 } } // namespace v8::internal
11241 11227
11242 #endif // V8_OBJECTS_H_ 11228 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698