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

Side by Side Diff: src/lookup.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master Created 4 years, 6 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/log-utils.cc ('k') | src/messages.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/lookup.h" 5 #include "src/lookup.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/elements.h" 9 #include "src/elements.h"
10 #include "src/field-type.h" 10 #include "src/field-type.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 Handle<Map> map(receiver->map(), isolate_); 293 Handle<Map> map(receiver->map(), isolate_);
294 294
295 // Dictionary maps can always have additional data properties. 295 // Dictionary maps can always have additional data properties.
296 if (map->is_dictionary_map()) { 296 if (map->is_dictionary_map()) {
297 state_ = TRANSITION; 297 state_ = TRANSITION;
298 if (map->IsJSGlobalObjectMap()) { 298 if (map->IsJSGlobalObjectMap()) {
299 // Install a property cell. 299 // Install a property cell.
300 auto cell = JSGlobalObject::EnsurePropertyCell( 300 auto cell = JSGlobalObject::EnsurePropertyCell(
301 Handle<JSGlobalObject>::cast(receiver), name()); 301 Handle<JSGlobalObject>::cast(receiver), name());
302 DCHECK(cell->value()->IsTheHole()); 302 DCHECK(cell->value()->IsTheHole(isolate_));
303 transition_ = cell; 303 transition_ = cell;
304 } else { 304 } else {
305 transition_ = map; 305 transition_ = map;
306 } 306 }
307 return; 307 return;
308 } 308 }
309 309
310 Handle<Map> transition = 310 Handle<Map> transition =
311 Map::TransitionToDataProperty(map, name_, value, attributes, store_mode); 311 Map::TransitionToDataProperty(map, name_, value, attributes, store_mode);
312 state_ = TRANSITION; 312 state_ = TRANSITION;
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 } 686 }
687 // Fall through. 687 // Fall through.
688 case INTERCEPTOR: 688 case INTERCEPTOR:
689 if (!is_element && map->IsJSGlobalObjectMap()) { 689 if (!is_element && map->IsJSGlobalObjectMap()) {
690 GlobalDictionary* dict = JSObject::cast(holder)->global_dictionary(); 690 GlobalDictionary* dict = JSObject::cast(holder)->global_dictionary();
691 int number = dict->FindEntry(name_); 691 int number = dict->FindEntry(name_);
692 if (number == GlobalDictionary::kNotFound) return NOT_FOUND; 692 if (number == GlobalDictionary::kNotFound) return NOT_FOUND;
693 number_ = static_cast<uint32_t>(number); 693 number_ = static_cast<uint32_t>(number);
694 DCHECK(dict->ValueAt(number_)->IsPropertyCell()); 694 DCHECK(dict->ValueAt(number_)->IsPropertyCell());
695 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_)); 695 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_));
696 if (cell->value()->IsTheHole()) return NOT_FOUND; 696 if (cell->value()->IsTheHole(isolate_)) return NOT_FOUND;
697 property_details_ = cell->property_details(); 697 property_details_ = cell->property_details();
698 has_property_ = true; 698 has_property_ = true;
699 switch (property_details_.kind()) { 699 switch (property_details_.kind()) {
700 case v8::internal::kData: 700 case v8::internal::kData:
701 return DATA; 701 return DATA;
702 case v8::internal::kAccessor: 702 case v8::internal::kAccessor:
703 return ACCESSOR; 703 return ACCESSOR;
704 } 704 }
705 } 705 }
706 return LookupInRegularHolder<is_element>(map, holder); 706 return LookupInRegularHolder<is_element>(map, holder);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 case v8::internal::kAccessor: 753 case v8::internal::kAccessor:
754 return ACCESSOR; 754 return ACCESSOR;
755 } 755 }
756 756
757 UNREACHABLE(); 757 UNREACHABLE();
758 return state_; 758 return state_;
759 } 759 }
760 760
761 } // namespace internal 761 } // namespace internal
762 } // namespace v8 762 } // namespace v8
OLDNEW
« no previous file with comments | « src/log-utils.cc ('k') | src/messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698