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

Side by Side Diff: src/accessors.cc

Issue 1984043002: Remove now-incorrect DataView accessor optimization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/accessors.h ('k') | src/compiler/access-info.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 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
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
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
OLDNEW
« no previous file with comments | « src/accessors.h ('k') | src/compiler/access-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698