Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: src/objects.cc

Issue 637253004: Use smi zero instead of undefine_value to zap dead weak cells. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698