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

Side by Side Diff: src/objects-inl.h

Issue 1700993002: Remove strong mode support from property loads. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment. Created 4 years, 10 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/objects.cc ('k') | src/runtime/runtime.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 ToPrimitiveHint hint) { 1011 ToPrimitiveHint hint) {
1012 if (input->IsPrimitive()) return input; 1012 if (input->IsPrimitive()) return input;
1013 return JSReceiver::ToPrimitive(Handle<JSReceiver>::cast(input), hint); 1013 return JSReceiver::ToPrimitive(Handle<JSReceiver>::cast(input), hint);
1014 } 1014 }
1015 1015
1016 1016
1017 bool Object::HasSpecificClassOf(String* name) { 1017 bool Object::HasSpecificClassOf(String* name) {
1018 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); 1018 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name);
1019 } 1019 }
1020 1020
1021 MaybeHandle<Object> Object::GetProperty(Handle<Object> object,
1022 Handle<Name> name) {
1023 LookupIterator it(object, name);
1024 return GetProperty(&it);
1025 }
1021 1026
1022 MaybeHandle<Object> Object::GetProperty(Handle<Object> object, 1027 MaybeHandle<Object> Object::GetElement(Isolate* isolate, Handle<Object> object,
1023 Handle<Name> name, 1028 uint32_t index) {
1024 LanguageMode language_mode) { 1029 LookupIterator it(isolate, object, index);
1025 LookupIterator it(object, name); 1030 return GetProperty(&it);
1026 return GetProperty(&it, language_mode);
1027 } 1031 }
1028 1032
1029 1033
1030 MaybeHandle<Object> Object::GetElement(Isolate* isolate, Handle<Object> object,
1031 uint32_t index,
1032 LanguageMode language_mode) {
1033 LookupIterator it(isolate, object, index);
1034 return GetProperty(&it, language_mode);
1035 }
1036
1037
1038 MaybeHandle<Object> Object::SetElement(Isolate* isolate, Handle<Object> object, 1034 MaybeHandle<Object> Object::SetElement(Isolate* isolate, Handle<Object> object,
1039 uint32_t index, Handle<Object> value, 1035 uint32_t index, Handle<Object> value,
1040 LanguageMode language_mode) { 1036 LanguageMode language_mode) {
1041 LookupIterator it(isolate, object, index); 1037 LookupIterator it(isolate, object, index);
1042 MAYBE_RETURN_NULL( 1038 MAYBE_RETURN_NULL(
1043 SetProperty(&it, value, language_mode, MAY_BE_STORE_FROM_KEYED)); 1039 SetProperty(&it, value, language_mode, MAY_BE_STORE_FROM_KEYED));
1044 return value; 1040 return value;
1045 } 1041 }
1046 1042
1047 MaybeHandle<Object> JSReceiver::GetPrototype(Isolate* isolate, 1043 MaybeHandle<Object> JSReceiver::GetPrototype(Isolate* isolate,
1048 Handle<JSReceiver> receiver) { 1044 Handle<JSReceiver> receiver) {
1049 // We don't expect access checks to be needed on JSProxy objects. 1045 // We don't expect access checks to be needed on JSProxy objects.
1050 DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject()); 1046 DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject());
1051 PrototypeIterator iter(isolate, receiver, 1047 PrototypeIterator iter(isolate, receiver,
1052 PrototypeIterator::START_AT_RECEIVER, 1048 PrototypeIterator::START_AT_RECEIVER,
1053 PrototypeIterator::END_AT_NON_HIDDEN); 1049 PrototypeIterator::END_AT_NON_HIDDEN);
1054 do { 1050 do {
1055 if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>(); 1051 if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>();
1056 } while (!iter.IsAtEnd()); 1052 } while (!iter.IsAtEnd());
1057 return PrototypeIterator::GetCurrent(iter); 1053 return PrototypeIterator::GetCurrent(iter);
1058 } 1054 }
1059 1055
1060
1061 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, Handle<Object> object, 1056 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, Handle<Object> object,
1062 const char* name, 1057 const char* name) {
1063 LanguageMode language_mode) {
1064 Handle<String> str = isolate->factory()->InternalizeUtf8String(name); 1058 Handle<String> str = isolate->factory()->InternalizeUtf8String(name);
1065 return GetProperty(object, str, language_mode); 1059 return GetProperty(object, str);
1066 } 1060 }
1067 1061
1068 1062
1069 #define FIELD_ADDR(p, offset) \ 1063 #define FIELD_ADDR(p, offset) \
1070 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag) 1064 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag)
1071 1065
1072 #define FIELD_ADDR_CONST(p, offset) \ 1066 #define FIELD_ADDR_CONST(p, offset) \
1073 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag) 1067 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag)
1074 1068
1075 #define READ_FIELD(p, offset) \ 1069 #define READ_FIELD(p, offset) \
(...skipping 5842 matching lines...) Expand 10 before | Expand all | Expand 10 after
6918 case ComparisonResult::kLessThan: 6912 case ComparisonResult::kLessThan:
6919 return Just(true); 6913 return Just(true);
6920 case ComparisonResult::kGreaterThan: 6914 case ComparisonResult::kGreaterThan:
6921 case ComparisonResult::kUndefined: 6915 case ComparisonResult::kUndefined:
6922 return Just(false); 6916 return Just(false);
6923 } 6917 }
6924 } 6918 }
6925 return Nothing<bool>(); 6919 return Nothing<bool>();
6926 } 6920 }
6927 6921
6928
6929 MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object, 6922 MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object,
6930 Handle<Name> name, 6923 Handle<Name> name) {
6931 LanguageMode language_mode) {
6932 LookupIterator it = 6924 LookupIterator it =
6933 LookupIterator::PropertyOrElement(name->GetIsolate(), object, name); 6925 LookupIterator::PropertyOrElement(name->GetIsolate(), object, name);
6934 return GetProperty(&it, language_mode); 6926 return GetProperty(&it);
6935 } 6927 }
6936 6928
6937 MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> receiver, 6929 MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> receiver,
6938 Handle<Name> name, 6930 Handle<Name> name,
6939 Handle<JSReceiver> holder, 6931 Handle<JSReceiver> holder) {
6940 LanguageMode language_mode) {
6941 LookupIterator it = LookupIterator::PropertyOrElement( 6932 LookupIterator it = LookupIterator::PropertyOrElement(
6942 name->GetIsolate(), receiver, name, holder); 6933 name->GetIsolate(), receiver, name, holder);
6943 return GetProperty(&it, language_mode); 6934 return GetProperty(&it);
6944 } 6935 }
6945 6936
6946 6937
6947 void JSReceiver::initialize_properties() { 6938 void JSReceiver::initialize_properties() {
6948 DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_fixed_array())); 6939 DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_fixed_array()));
6949 DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_properties_dictionary())); 6940 DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_properties_dictionary()));
6950 if (map()->is_dictionary_map()) { 6941 if (map()->is_dictionary_map()) {
6951 WRITE_FIELD(this, kPropertiesOffset, 6942 WRITE_FIELD(this, kPropertiesOffset,
6952 GetHeap()->empty_properties_dictionary()); 6943 GetHeap()->empty_properties_dictionary());
6953 } else { 6944 } else {
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
7685 #undef WRITE_INT64_FIELD 7676 #undef WRITE_INT64_FIELD
7686 #undef READ_BYTE_FIELD 7677 #undef READ_BYTE_FIELD
7687 #undef WRITE_BYTE_FIELD 7678 #undef WRITE_BYTE_FIELD
7688 #undef NOBARRIER_READ_BYTE_FIELD 7679 #undef NOBARRIER_READ_BYTE_FIELD
7689 #undef NOBARRIER_WRITE_BYTE_FIELD 7680 #undef NOBARRIER_WRITE_BYTE_FIELD
7690 7681
7691 } // namespace internal 7682 } // namespace internal
7692 } // namespace v8 7683 } // namespace v8
7693 7684
7694 #endif // V8_OBJECTS_INL_H_ 7685 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698