| 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 9713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9724 return isolate->factory()->undefined_value(); | 9724 return isolate->factory()->undefined_value(); |
| 9725 } | 9725 } |
| 9726 return result; | 9726 return result; |
| 9727 } | 9727 } |
| 9728 | 9728 |
| 9729 | 9729 |
| 9730 Handle<JSObject> Script::GetWrapper(Handle<Script> script) { | 9730 Handle<JSObject> Script::GetWrapper(Handle<Script> script) { |
| 9731 Isolate* isolate = script->GetIsolate(); | 9731 Isolate* isolate = script->GetIsolate(); |
| 9732 if (!script->wrapper()->IsUndefined()) { | 9732 if (!script->wrapper()->IsUndefined()) { |
| 9733 Handle<WeakCell> cell(WeakCell::cast(script->wrapper())); | 9733 Handle<WeakCell> cell(WeakCell::cast(script->wrapper())); |
| 9734 if (!cell->value()->IsUndefined()) { | 9734 if (!cell->cleared()) { |
| 9735 // Return a handle for the existing script wrapper from the cache. | 9735 // Return a handle for the existing script wrapper from the cache. |
| 9736 return handle(JSObject::cast(cell->value())); | 9736 return handle(JSObject::cast(cell->value())); |
| 9737 } | 9737 } |
| 9738 // If we found an empty WeakCell, that means the script wrapper was | 9738 // If we found an empty WeakCell, that means the script wrapper was |
| 9739 // GCed. We are not notified directly of that, so we decrement here | 9739 // GCed. We are not notified directly of that, so we decrement here |
| 9740 // so that we at least don't count double for any given script. | 9740 // so that we at least don't count double for any given script. |
| 9741 isolate->counters()->script_wrappers()->Decrement(); | 9741 isolate->counters()->script_wrappers()->Decrement(); |
| 9742 } | 9742 } |
| 9743 // Construct a new script wrapper. | 9743 // Construct a new script wrapper. |
| 9744 isolate->counters()->script_wrappers()->Increment(); | 9744 isolate->counters()->script_wrappers()->Increment(); |
| (...skipping 6664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16409 Handle<DependentCode> codes = | 16409 Handle<DependentCode> codes = |
| 16410 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16410 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
| 16411 DependentCode::kPropertyCellChangedGroup, | 16411 DependentCode::kPropertyCellChangedGroup, |
| 16412 info->object_wrapper()); | 16412 info->object_wrapper()); |
| 16413 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16413 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
| 16414 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16414 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 16415 cell, info->zone()); | 16415 cell, info->zone()); |
| 16416 } | 16416 } |
| 16417 | 16417 |
| 16418 } } // namespace v8::internal | 16418 } } // namespace v8::internal |
| OLD | NEW |