| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 9822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9833 return isolate->factory()->undefined_value(); | 9833 return isolate->factory()->undefined_value(); |
| 9834 } | 9834 } |
| 9835 return result; | 9835 return result; |
| 9836 } | 9836 } |
| 9837 | 9837 |
| 9838 | 9838 |
| 9839 Handle<JSObject> Script::GetWrapper(Handle<Script> script) { | 9839 Handle<JSObject> Script::GetWrapper(Handle<Script> script) { |
| 9840 Isolate* isolate = script->GetIsolate(); | 9840 Isolate* isolate = script->GetIsolate(); |
| 9841 if (!script->wrapper()->IsUndefined()) { | 9841 if (!script->wrapper()->IsUndefined()) { |
| 9842 Handle<WeakCell> cell(WeakCell::cast(script->wrapper())); | 9842 Handle<WeakCell> cell(WeakCell::cast(script->wrapper())); |
| 9843 if (!cell->value()->IsUndefined()) { | 9843 if (!cell->cleared()) { |
| 9844 // Return a handle for the existing script wrapper from the cache. | 9844 // Return a handle for the existing script wrapper from the cache. |
| 9845 return handle(JSObject::cast(cell->value())); | 9845 return handle(JSObject::cast(cell->value())); |
| 9846 } | 9846 } |
| 9847 // If we found an empty WeakCell, that means the script wrapper was | 9847 // If we found an empty WeakCell, that means the script wrapper was |
| 9848 // GCed. We are not notified directly of that, so we decrement here | 9848 // GCed. We are not notified directly of that, so we decrement here |
| 9849 // so that we at least don't count double for any given script. | 9849 // so that we at least don't count double for any given script. |
| 9850 isolate->counters()->script_wrappers()->Decrement(); | 9850 isolate->counters()->script_wrappers()->Decrement(); |
| 9851 } | 9851 } |
| 9852 // Construct a new script wrapper. | 9852 // Construct a new script wrapper. |
| 9853 isolate->counters()->script_wrappers()->Increment(); | 9853 isolate->counters()->script_wrappers()->Increment(); |
| (...skipping 6641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16495 Handle<DependentCode> codes = | 16495 Handle<DependentCode> codes = |
| 16496 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16496 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
| 16497 DependentCode::kPropertyCellChangedGroup, | 16497 DependentCode::kPropertyCellChangedGroup, |
| 16498 info->object_wrapper()); | 16498 info->object_wrapper()); |
| 16499 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16499 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
| 16500 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16500 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 16501 cell, info->zone()); | 16501 cell, info->zone()); |
| 16502 } | 16502 } |
| 16503 | 16503 |
| 16504 } } // namespace v8::internal | 16504 } } // namespace v8::internal |
| OLD | NEW |