| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1858 kNumberOfScopes | 1858 kNumberOfScopes |
| 1859 }; | 1859 }; |
| 1860 | 1860 |
| 1861 Scope(GCTracer* tracer, ScopeId scope) | 1861 Scope(GCTracer* tracer, ScopeId scope) |
| 1862 : tracer_(tracer), | 1862 : tracer_(tracer), |
| 1863 scope_(scope) { | 1863 scope_(scope) { |
| 1864 start_time_ = OS::TimeCurrentMillis(); | 1864 start_time_ = OS::TimeCurrentMillis(); |
| 1865 } | 1865 } |
| 1866 | 1866 |
| 1867 ~Scope() { | 1867 ~Scope() { |
| 1868 ASSERT((0 <= scope_) && (scope_ < kNumberOfScopes)); | 1868 ASSERT(scope_ < kNumberOfScopes); // scope_ is unsigned. |
| 1869 tracer_->scopes_[scope_] += OS::TimeCurrentMillis() - start_time_; | 1869 tracer_->scopes_[scope_] += OS::TimeCurrentMillis() - start_time_; |
| 1870 } | 1870 } |
| 1871 | 1871 |
| 1872 private: | 1872 private: |
| 1873 GCTracer* tracer_; | 1873 GCTracer* tracer_; |
| 1874 ScopeId scope_; | 1874 ScopeId scope_; |
| 1875 double start_time_; | 1875 double start_time_; |
| 1876 }; | 1876 }; |
| 1877 | 1877 |
| 1878 GCTracer(); | 1878 GCTracer(); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2123 // Return whether this object should be retained. If NULL is returned the | 2123 // Return whether this object should be retained. If NULL is returned the |
| 2124 // object has no references. Otherwise the address of the retained object | 2124 // object has no references. Otherwise the address of the retained object |
| 2125 // should be returned as in some GC situations the object has been moved. | 2125 // should be returned as in some GC situations the object has been moved. |
| 2126 virtual Object* RetainAs(Object* object) = 0; | 2126 virtual Object* RetainAs(Object* object) = 0; |
| 2127 }; | 2127 }; |
| 2128 | 2128 |
| 2129 | 2129 |
| 2130 } } // namespace v8::internal | 2130 } } // namespace v8::internal |
| 2131 | 2131 |
| 2132 #endif // V8_HEAP_H_ | 2132 #endif // V8_HEAP_H_ |
| OLD | NEW |