OLD | NEW |
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 #include "src/accessors.h" | 5 #include "src/accessors.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/execution.h" | 10 #include "src/execution.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if (map->instance_type() < FIRST_NONSTRING_TYPE) { | 79 if (map->instance_type() < FIRST_NONSTRING_TYPE) { |
80 return CheckForName(name, isolate->factory()->length_string(), | 80 return CheckForName(name, isolate->factory()->length_string(), |
81 String::kLengthOffset, object_offset); | 81 String::kLengthOffset, object_offset); |
82 } | 82 } |
83 | 83 |
84 return false; | 84 return false; |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 | 88 |
89 bool Accessors::IsJSArrayBufferViewFieldAccessor(Handle<Map> map, | |
90 Handle<Name> name, | |
91 int* object_offset) { | |
92 DCHECK(name->IsUniqueName()); | |
93 Isolate* isolate = name->GetIsolate(); | |
94 | |
95 switch (map->instance_type()) { | |
96 case JS_DATA_VIEW_TYPE: | |
97 return CheckForName(name, isolate->factory()->byte_length_string(), | |
98 JSDataView::kByteLengthOffset, object_offset) || | |
99 CheckForName(name, isolate->factory()->byte_offset_string(), | |
100 JSDataView::kByteOffsetOffset, object_offset); | |
101 default: | |
102 return false; | |
103 } | |
104 } | |
105 | |
106 namespace { | 89 namespace { |
107 | 90 |
108 MUST_USE_RESULT MaybeHandle<Object> ReplaceAccessorWithDataProperty( | 91 MUST_USE_RESULT MaybeHandle<Object> ReplaceAccessorWithDataProperty( |
109 Isolate* isolate, Handle<Object> receiver, Handle<JSObject> holder, | 92 Isolate* isolate, Handle<Object> receiver, Handle<JSObject> holder, |
110 Handle<Name> name, Handle<Object> value) { | 93 Handle<Name> name, Handle<Object> value) { |
111 LookupIterator it(receiver, name, holder, | 94 LookupIterator it(receiver, name, holder, |
112 LookupIterator::OWN_SKIP_INTERCEPTOR); | 95 LookupIterator::OWN_SKIP_INTERCEPTOR); |
113 // Skip any access checks we might hit. This accessor should never hit in a | 96 // Skip any access checks we might hit. This accessor should never hit in a |
114 // situation where the caller does not have access. | 97 // situation where the caller does not have access. |
115 if (it.state() == LookupIterator::ACCESS_CHECK) { | 98 if (it.state() == LookupIterator::ACCESS_CHECK) { |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 Isolate* isolate = name->GetIsolate(); | 1163 Isolate* isolate = name->GetIsolate(); |
1181 Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport, | 1164 Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport, |
1182 &ModuleSetExport, attributes); | 1165 &ModuleSetExport, attributes); |
1183 info->set_data(Smi::FromInt(index)); | 1166 info->set_data(Smi::FromInt(index)); |
1184 return info; | 1167 return info; |
1185 } | 1168 } |
1186 | 1169 |
1187 | 1170 |
1188 } // namespace internal | 1171 } // namespace internal |
1189 } // namespace v8 | 1172 } // namespace v8 |
OLD | NEW |