OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // If the bottom bit it set, then this contains a pointer to a wrapper obj
ect in the remainging bits. | 187 // If the bottom bit it set, then this contains a pointer to a wrapper obj
ect in the remainging bits. |
188 // If the bottom bit is clear, then this contains a pointer to the wrapper
type info in the remaining bits. | 188 // If the bottom bit is clear, then this contains a pointer to the wrapper
type info in the remaining bits. |
189 uintptr_t m_wrapperOrTypeInfo; | 189 uintptr_t m_wrapperOrTypeInfo; |
190 | 190 |
191 static void makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Object
>* wrapper, ScriptWrappable* key) | 191 static void makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Object
>* wrapper, ScriptWrappable* key) |
192 { | 192 { |
193 ASSERT(*(key->unsafePersistent().persistent()) == *wrapper); | 193 ASSERT(*(key->unsafePersistent().persistent()) == *wrapper); |
194 | 194 |
195 // Note: |object| might not be equal to |key|, e.g., if ScriptWrappable
isn't a left-most base class. | 195 // Note: |object| might not be equal to |key|, e.g., if ScriptWrappable
isn't a left-most base class. |
196 void* object = toNative(*wrapper); | 196 void* object = toNative(*wrapper); |
197 WrapperTypeInfo* info = toWrapperTypeInfo(*wrapper); | 197 const WrapperTypeInfo* info = toWrapperTypeInfo(*wrapper); |
198 ASSERT(info->derefObjectFunction); | 198 ASSERT(info->derefObjectFunction); |
199 | 199 |
200 key->disposeWrapper(wrapper, info); | 200 key->disposeWrapper(wrapper, info); |
201 // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed | 201 // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed |
202 // inside key->deref(), which causes Node destructions. We should | 202 // inside key->deref(), which causes Node destructions. We should |
203 // make Node destructions incremental. | 203 // make Node destructions incremental. |
204 info->derefObject(object); | 204 info->derefObject(object); |
205 } | 205 } |
206 }; | 206 }; |
207 | 207 |
208 } // namespace WebCore | 208 } // namespace WebCore |
209 | 209 |
210 #endif // ScriptWrappable_h | 210 #endif // ScriptWrappable_h |
OLD | NEW |