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

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: Remove ifdef DEBUG 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 void Zap(Object* value) {
Michael Starzinger 2013/10/04 11:33:40 nit: Maybe add a short one-liner comment explainin
ulan 2013/10/04 11:37:18 Done.
4005 int capacity = Capacity();
4006 for (int i = 0; i < capacity; i++) {
4007 set(EntryToIndex(i), value);
4008 set(EntryToValueIndex(i), value);
4009 }
4010 }
4011
4004 private: 4012 private:
4005 friend class MarkCompactCollector; 4013 friend class MarkCompactCollector;
4006 4014
4007 void AddEntry(int entry, Object* key, Object* value); 4015 void AddEntry(int entry, Object* key, Object* value);
4008 4016
4009 // Returns the index to the value of an entry. 4017 // Returns the index to the value of an entry.
4010 static inline int EntryToValueIndex(int entry) { 4018 static inline int EntryToValueIndex(int entry) {
4011 return EntryToIndex(entry) + 1; 4019 return EntryToIndex(entry) + 1;
4012 } 4020 }
4013 }; 4021 };
(...skipping 6271 matching lines...) Expand 10 before | Expand all | Expand 10 after
10285 } else { 10293 } else {
10286 value &= ~(1 << bit_position); 10294 value &= ~(1 << bit_position);
10287 } 10295 }
10288 return value; 10296 return value;
10289 } 10297 }
10290 }; 10298 };
10291 10299
10292 } } // namespace v8::internal 10300 } } // namespace v8::internal
10293 10301
10294 #endif // V8_OBJECTS_H_ 10302 #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