OLD | NEW |
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 5260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5271 } | 5271 } |
5272 | 5272 |
5273 void SetAstId(int i, BailoutId value) { | 5273 void SetAstId(int i, BailoutId value) { |
5274 SetAstIdRaw(i, Smi::FromInt(value.ToInt())); | 5274 SetAstIdRaw(i, Smi::FromInt(value.ToInt())); |
5275 } | 5275 } |
5276 | 5276 |
5277 int DeoptCount() { | 5277 int DeoptCount() { |
5278 return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize; | 5278 return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize; |
5279 } | 5279 } |
5280 | 5280 |
5281 static int LengthFor(int entry_count) { | 5281 // Allocates a DeoptimizationInputData. |
5282 return IndexForEntry(entry_count); | 5282 MUST_USE_RESULT static MaybeObject* Allocate(Isolate* isolate, |
5283 } | 5283 int deopt_entry_count, |
| 5284 PretenureFlag pretenure); |
5284 | 5285 |
5285 // Casting. | 5286 // Casting. |
5286 static inline DeoptimizationInputData* cast(Object* obj); | 5287 static inline DeoptimizationInputData* cast(Object* obj); |
5287 | 5288 |
5288 #ifdef ENABLE_DISASSEMBLER | 5289 #ifdef ENABLE_DISASSEMBLER |
5289 void DeoptimizationInputDataPrint(FILE* out); | 5290 void DeoptimizationInputDataPrint(FILE* out); |
5290 #endif | 5291 #endif |
5291 | 5292 |
5292 private: | 5293 private: |
5293 static int IndexForEntry(int i) { | 5294 static int IndexForEntry(int i) { |
5294 return kFirstDeoptEntryIndex + (i * kDeoptEntrySize); | 5295 return kFirstDeoptEntryIndex + (i * kDeoptEntrySize); |
5295 } | 5296 } |
| 5297 |
| 5298 static int LengthFor(int entry_count) { |
| 5299 return IndexForEntry(entry_count); |
| 5300 } |
5296 }; | 5301 }; |
5297 | 5302 |
5298 | 5303 |
5299 // DeoptimizationOutputData is a fixed array used to hold the deoptimization | 5304 // DeoptimizationOutputData is a fixed array used to hold the deoptimization |
5300 // data for code generated by the full compiler. | 5305 // data for code generated by the full compiler. |
5301 // The format of the these objects is | 5306 // The format of the these objects is |
5302 // [i * 2]: Ast ID for ith deoptimization. | 5307 // [i * 2]: Ast ID for ith deoptimization. |
5303 // [i * 2 + 1]: PC and state of ith deoptimization | 5308 // [i * 2 + 1]: PC and state of ith deoptimization |
5304 class DeoptimizationOutputData: public FixedArray { | 5309 class DeoptimizationOutputData: public FixedArray { |
5305 public: | 5310 public: |
5306 int DeoptPoints() { return length() / 2; } | 5311 int DeoptPoints() { return length() / 2; } |
5307 | 5312 |
5308 BailoutId AstId(int index) { | 5313 BailoutId AstId(int index) { |
5309 return BailoutId(Smi::cast(get(index * 2))->value()); | 5314 return BailoutId(Smi::cast(get(index * 2))->value()); |
5310 } | 5315 } |
5311 | 5316 |
5312 void SetAstId(int index, BailoutId id) { | 5317 void SetAstId(int index, BailoutId id) { |
5313 set(index * 2, Smi::FromInt(id.ToInt())); | 5318 set(index * 2, Smi::FromInt(id.ToInt())); |
5314 } | 5319 } |
5315 | 5320 |
5316 Smi* PcAndState(int index) { return Smi::cast(get(1 + index * 2)); } | 5321 Smi* PcAndState(int index) { return Smi::cast(get(1 + index * 2)); } |
5317 void SetPcAndState(int index, Smi* offset) { set(1 + index * 2, offset); } | 5322 void SetPcAndState(int index, Smi* offset) { set(1 + index * 2, offset); } |
5318 | 5323 |
5319 static int LengthOfFixedArray(int deopt_points) { | 5324 static int LengthOfFixedArray(int deopt_points) { |
5320 return deopt_points * 2; | 5325 return deopt_points * 2; |
5321 } | 5326 } |
5322 | 5327 |
| 5328 // Allocates a DeoptimizationOutputData. |
| 5329 MUST_USE_RESULT static MaybeObject* Allocate(Isolate* isolate, |
| 5330 int number_of_deopt_points, |
| 5331 PretenureFlag pretenure); |
| 5332 |
5323 // Casting. | 5333 // Casting. |
5324 static inline DeoptimizationOutputData* cast(Object* obj); | 5334 static inline DeoptimizationOutputData* cast(Object* obj); |
5325 | 5335 |
5326 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) | 5336 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) |
5327 void DeoptimizationOutputDataPrint(FILE* out); | 5337 void DeoptimizationOutputDataPrint(FILE* out); |
5328 #endif | 5338 #endif |
5329 }; | 5339 }; |
5330 | 5340 |
5331 | 5341 |
5332 // Forward declaration. | 5342 // Forward declaration. |
(...skipping 5647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10980 } else { | 10990 } else { |
10981 value &= ~(1 << bit_position); | 10991 value &= ~(1 << bit_position); |
10982 } | 10992 } |
10983 return value; | 10993 return value; |
10984 } | 10994 } |
10985 }; | 10995 }; |
10986 | 10996 |
10987 } } // namespace v8::internal | 10997 } } // namespace v8::internal |
10988 | 10998 |
10989 #endif // V8_OBJECTS_H_ | 10999 #endif // V8_OBJECTS_H_ |
OLD | NEW |