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

Side by Side Diff: src/objects.h

Issue 197283017: Refactor GetCodeCopyFromTemplate to get a single point where objects are replaced in code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comment Created 6 years, 9 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/ic.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 5354 matching lines...) Expand 10 before | Expand all | Expand 10 after
5365 5365
5366 // [constant_pool]: The constant pool for this function. 5366 // [constant_pool]: The constant pool for this function.
5367 inline ConstantPoolArray* constant_pool(); 5367 inline ConstantPoolArray* constant_pool();
5368 inline void set_constant_pool(Object* constant_pool); 5368 inline void set_constant_pool(Object* constant_pool);
5369 5369
5370 // Get the safepoint entry for the given pc. 5370 // Get the safepoint entry for the given pc.
5371 SafepointEntry GetSafepointEntry(Address pc); 5371 SafepointEntry GetSafepointEntry(Address pc);
5372 5372
5373 // Find an object in a stub with a specified map 5373 // Find an object in a stub with a specified map
5374 Object* FindNthObject(int n, Map* match_map); 5374 Object* FindNthObject(int n, Map* match_map);
5375 void ReplaceNthObject(int n, Map* match_map, Object* replace_with);
5376 5375
5377 // Find the first allocation site in an IC stub. 5376 // Find the first allocation site in an IC stub.
5378 AllocationSite* FindFirstAllocationSite(); 5377 AllocationSite* FindFirstAllocationSite();
5379 5378
5380 // Find the first map in an IC stub. 5379 // Find the first map in an IC stub.
5381 Map* FindFirstMap(); 5380 Map* FindFirstMap();
5382 void FindAllMaps(MapHandleList* maps); 5381 void FindAllMaps(MapHandleList* maps);
5383 void FindAllTypes(TypeHandleList* types); 5382 void FindAllTypes(TypeHandleList* types);
5384 void ReplaceFirstMap(Map* replace);
5385 5383
5386 // Find the first handler in an IC stub. 5384 // Find the first handler in an IC stub.
5387 Code* FindFirstHandler(); 5385 Code* FindFirstHandler();
5388 5386
5389 // Find |length| handlers and put them into |code_list|. Returns false if not 5387 // Find |length| handlers and put them into |code_list|. Returns false if not
5390 // enough handlers can be found. 5388 // enough handlers can be found.
5391 bool FindHandlers(CodeHandleList* code_list, int length = -1); 5389 bool FindHandlers(CodeHandleList* code_list, int length = -1);
5392 5390
5393 // Find the first name in an IC stub. 5391 // Find the first name in an IC stub.
5394 Name* FindFirstName(); 5392 Name* FindFirstName();
5395 5393
5396 void ReplaceNthCell(int n, Cell* replace_with); 5394 class FindAndReplacePattern;
5395 // For each (map-to-find, object-to-replace) pair in the pattern, this
5396 // function replaces the corresponding placeholder in the code with the
5397 // object-to-replace. The function assumes that pairs in the pattern come in
5398 // the same order as the placeholders in the code.
5399 void FindAndReplace(const FindAndReplacePattern& pattern);
5397 5400
5398 // The entire code object including its header is copied verbatim to the 5401 // The entire code object including its header is copied verbatim to the
5399 // snapshot so that it can be written in one, fast, memcpy during 5402 // snapshot so that it can be written in one, fast, memcpy during
5400 // deserialization. The deserializer will overwrite some pointers, rather 5403 // deserialization. The deserializer will overwrite some pointers, rather
5401 // like a runtime linker, but the random allocation addresses used in the 5404 // like a runtime linker, but the random allocation addresses used in the
5402 // mksnapshot process would still be present in the unlinked snapshot data, 5405 // mksnapshot process would still be present in the unlinked snapshot data,
5403 // which would make snapshot production non-reproducible. This method wipes 5406 // which would make snapshot production non-reproducible. This method wipes
5404 // out the to-be-overwritten header data for reproducible snapshots. 5407 // out the to-be-overwritten header data for reproducible snapshots.
5405 inline void WipeOutHeader(); 5408 inline void WipeOutHeader();
5406 5409
(...skipping 5372 matching lines...) Expand 10 before | Expand all | Expand 10 after
10779 } else { 10782 } else {
10780 value &= ~(1 << bit_position); 10783 value &= ~(1 << bit_position);
10781 } 10784 }
10782 return value; 10785 return value;
10783 } 10786 }
10784 }; 10787 };
10785 10788
10786 } } // namespace v8::internal 10789 } } // namespace v8::internal
10787 10790
10788 #endif // V8_OBJECTS_H_ 10791 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698