Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1538 public: | 1538 public: |
| 1539 EnumerateOptimizedFunctionsVisitor(Handle<SharedFunctionInfo>* sfis, | 1539 EnumerateOptimizedFunctionsVisitor(Handle<SharedFunctionInfo>* sfis, |
| 1540 Handle<Code>* code_objects, | 1540 Handle<Code>* code_objects, |
| 1541 int* count) | 1541 int* count) |
| 1542 : sfis_(sfis), code_objects_(code_objects), count_(count) { } | 1542 : sfis_(sfis), code_objects_(code_objects), count_(count) { } |
| 1543 | 1543 |
| 1544 virtual void EnterContext(Context* context) {} | 1544 virtual void EnterContext(Context* context) {} |
| 1545 virtual void LeaveContext(Context* context) {} | 1545 virtual void LeaveContext(Context* context) {} |
| 1546 | 1546 |
| 1547 virtual void VisitFunction(JSFunction* function) { | 1547 virtual void VisitFunction(JSFunction* function) { |
| 1548 SharedFunctionInfo* sfi = SharedFunctionInfo::cast(function->shared()); | |
| 1549 if (sfi->script()->IsScript() | |
|
Kasper Lund
2011/06/17 05:20:21
Maybe cache sfi->script() in a new local? That wil
mnaganov (inactive)
2011/06/17 08:37:41
Done.
| |
| 1550 && !Script::cast(sfi->script())->HasValidSource()) return; | |
| 1548 if (sfis_ != NULL) { | 1551 if (sfis_ != NULL) { |
| 1549 sfis_[*count_] = Handle<SharedFunctionInfo>(function->shared()); | 1552 sfis_[*count_] = Handle<SharedFunctionInfo>(sfi); |
| 1550 } | 1553 } |
| 1551 if (code_objects_ != NULL) { | 1554 if (code_objects_ != NULL) { |
| 1552 ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION); | 1555 ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION); |
| 1553 code_objects_[*count_] = Handle<Code>(function->code()); | 1556 code_objects_[*count_] = Handle<Code>(function->code()); |
| 1554 } | 1557 } |
| 1555 *count_ = *count_ + 1; | 1558 *count_ = *count_ + 1; |
| 1556 } | 1559 } |
| 1557 | 1560 |
| 1558 private: | 1561 private: |
| 1559 Handle<SharedFunctionInfo>* sfis_; | 1562 Handle<SharedFunctionInfo>* sfis_; |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1991 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { | 1994 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { |
| 1992 ASSERT(sampler->IsActive()); | 1995 ASSERT(sampler->IsActive()); |
| 1993 ScopedLock lock(mutex_); | 1996 ScopedLock lock(mutex_); |
| 1994 ASSERT(active_samplers_ != NULL); | 1997 ASSERT(active_samplers_ != NULL); |
| 1995 bool removed = active_samplers_->RemoveElement(sampler); | 1998 bool removed = active_samplers_->RemoveElement(sampler); |
| 1996 ASSERT(removed); | 1999 ASSERT(removed); |
| 1997 USE(removed); | 2000 USE(removed); |
| 1998 } | 2001 } |
| 1999 | 2002 |
| 2000 } } // namespace v8::internal | 2003 } } // namespace v8::internal |
| OLD | NEW |