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

Side by Side Diff: src/lookup.cc

Issue 965723002: Ensure we can reliably check the cell for validity of global property (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/objects.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/deoptimizer.h" 8 #include "src/deoptimizer.h"
9 #include "src/lookup.h" 9 #include "src/lookup.h"
10 #include "src/lookup-inl.h" 10 #include "src/lookup-inl.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 state_ = TRANSITION; 138 state_ = TRANSITION;
139 transition_ = transition; 139 transition_ = transition;
140 140
141 if (receiver->IsGlobalObject()) { 141 if (receiver->IsGlobalObject()) {
142 // Install a property cell. 142 // Install a property cell.
143 InternalizeName(); 143 InternalizeName();
144 auto cell = GlobalObject::EnsurePropertyCell( 144 auto cell = GlobalObject::EnsurePropertyCell(
145 Handle<GlobalObject>::cast(receiver), name()); 145 Handle<GlobalObject>::cast(receiver), name());
146 DCHECK(cell->value()->IsTheHole()); 146 DCHECK(cell->value()->IsTheHole());
147 transition_ = cell; 147 transition_ = cell;
148 PropertyCell::SetValueInferType(cell, value);
148 } else if (transition->GetBackPointer()->IsMap()) { 149 } else if (transition->GetBackPointer()->IsMap()) {
149 property_details_ = transition->GetLastDescriptorDetails(); 150 property_details_ = transition->GetLastDescriptorDetails();
150 has_property_ = true; 151 has_property_ = true;
151 } 152 }
152 } 153 }
153 154
154 155
155 void LookupIterator::ApplyTransitionToDataProperty() { 156 void LookupIterator::ApplyTransitionToDataProperty() {
156 DCHECK_EQ(TRANSITION, state_); 157 DCHECK_EQ(TRANSITION, state_);
157 158
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 354 }
354 return false; 355 return false;
355 } 356 }
356 357
357 358
358 void LookupIterator::InternalizeName() { 359 void LookupIterator::InternalizeName() {
359 if (name_->IsUniqueName()) return; 360 if (name_->IsUniqueName()) return;
360 name_ = factory()->InternalizeString(Handle<String>::cast(name_)); 361 name_ = factory()->InternalizeString(Handle<String>::cast(name_));
361 } 362 }
362 } } // namespace v8::internal 363 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698