OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // checks asserts. | 246 // checks asserts. |
247 bool isAllocationAllowed() const { return !m_noAllocationCount; } | 247 bool isAllocationAllowed() const { return !m_noAllocationCount; } |
248 void enterNoAllocationScope() { m_noAllocationCount++; } | 248 void enterNoAllocationScope() { m_noAllocationCount++; } |
249 void leaveNoAllocationScope() { m_noAllocationCount--; } | 249 void leaveNoAllocationScope() { m_noAllocationCount--; } |
250 bool isWrapperTracingForbidden() { return isMixinInConstruction(); } | 250 bool isWrapperTracingForbidden() { return isMixinInConstruction(); } |
251 bool isGCForbidden() const { | 251 bool isGCForbidden() const { |
252 return m_gcForbiddenCount || isMixinInConstruction(); | 252 return m_gcForbiddenCount || isMixinInConstruction(); |
253 } | 253 } |
254 void enterGCForbiddenScope() { m_gcForbiddenCount++; } | 254 void enterGCForbiddenScope() { m_gcForbiddenCount++; } |
255 void leaveGCForbiddenScope() { | 255 void leaveGCForbiddenScope() { |
256 DCHECK_GE(m_gcForbiddenCount, 0u); | 256 DCHECK_GT(m_gcForbiddenCount, 0u); |
257 m_gcForbiddenCount--; | 257 m_gcForbiddenCount--; |
258 } | 258 } |
259 bool isMixinInConstruction() const { return m_mixinsBeingConstructedCount; } | 259 bool isMixinInConstruction() const { return m_mixinsBeingConstructedCount; } |
260 void enterMixinConstructionScope() { m_mixinsBeingConstructedCount++; } | 260 void enterMixinConstructionScope() { m_mixinsBeingConstructedCount++; } |
261 void leaveMixinConstructionScope() { | 261 void leaveMixinConstructionScope() { |
262 DCHECK_GT(m_mixinsBeingConstructedCount, 0u); | 262 DCHECK_GT(m_mixinsBeingConstructedCount, 0u); |
263 m_mixinsBeingConstructedCount--; | 263 m_mixinsBeingConstructedCount--; |
264 } | 264 } |
265 bool sweepForbidden() const { return m_sweepForbidden; } | 265 bool sweepForbidden() const { return m_sweepForbidden; } |
266 | 266 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 class ThreadStateFor<AnyThread> { | 699 class ThreadStateFor<AnyThread> { |
700 STATIC_ONLY(ThreadStateFor); | 700 STATIC_ONLY(ThreadStateFor); |
701 | 701 |
702 public: | 702 public: |
703 static ThreadState* state() { return ThreadState::current(); } | 703 static ThreadState* state() { return ThreadState::current(); } |
704 }; | 704 }; |
705 | 705 |
706 } // namespace blink | 706 } // namespace blink |
707 | 707 |
708 #endif // ThreadState_h | 708 #endif // ThreadState_h |
OLD | NEW |