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

Side by Side Diff: src/objects.h

Issue 25702008: Enable weak embedded objects in optimized code with a fix for heap verifier. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add comment Created 7 years, 2 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') | no next file » | 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 3983 matching lines...) Expand 10 before | Expand all | Expand 10 after
3994 } 3994 }
3995 3995
3996 // Looks up the value associated with the given key. The hole value is 3996 // Looks up the value associated with the given key. The hole value is
3997 // returned in case the key is not present. 3997 // returned in case the key is not present.
3998 Object* Lookup(Object* key); 3998 Object* Lookup(Object* key);
3999 3999
4000 // Adds (or overwrites) the value associated with the given key. Mapping a 4000 // Adds (or overwrites) the value associated with the given key. Mapping a
4001 // key to the hole value causes removal of the whole entry. 4001 // key to the hole value causes removal of the whole entry.
4002 MUST_USE_RESULT MaybeObject* Put(Object* key, Object* value); 4002 MUST_USE_RESULT MaybeObject* Put(Object* key, Object* value);
4003 4003
4004 // This function is called when heap verification is turned on.
4005 void Zap(Object* value) {
4006 int capacity = Capacity();
4007 for (int i = 0; i < capacity; i++) {
4008 set(EntryToIndex(i), value);
4009 set(EntryToValueIndex(i), value);
4010 }
4011 }
4012
4004 private: 4013 private:
4005 friend class MarkCompactCollector; 4014 friend class MarkCompactCollector;
4006 4015
4007 void AddEntry(int entry, Object* key, Object* value); 4016 void AddEntry(int entry, Object* key, Object* value);
4008 4017
4009 // Returns the index to the value of an entry. 4018 // Returns the index to the value of an entry.
4010 static inline int EntryToValueIndex(int entry) { 4019 static inline int EntryToValueIndex(int entry) {
4011 return EntryToIndex(entry) + 1; 4020 return EntryToIndex(entry) + 1;
4012 } 4021 }
4013 }; 4022 };
(...skipping 6271 matching lines...) Expand 10 before | Expand all | Expand 10 after
10285 } else { 10294 } else {
10286 value &= ~(1 << bit_position); 10295 value &= ~(1 << bit_position);
10287 } 10296 }
10288 return value; 10297 return value;
10289 } 10298 }
10290 }; 10299 };
10291 10300
10292 } } // namespace v8::internal 10301 } } // namespace v8::internal
10293 10302
10294 #endif // V8_OBJECTS_H_ 10303 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698