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

Side by Side Diff: src/objects.h

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

Powered by Google App Engine
This is Rietveld 408576698