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

Side by Side Diff: src/api-natives.cc

Issue 2283713002: [api] Use handle for ConfigureInstance (Closed)
Patch Set: Bring back comment Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/api-natives.h" 5 #include "src/api-natives.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/isolate-inl.h" 8 #include "src/isolate-inl.h"
9 #include "src/lookup.h" 9 #include "src/lookup.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 192 }
193 info = info->GetParent(isolate); 193 info = info->GetParent(isolate);
194 } 194 }
195 195
196 if (max_number_of_properties > 0) { 196 if (max_number_of_properties > 0) {
197 int valid_descriptors = 0; 197 int valid_descriptors = 0;
198 // Use a temporary FixedArray to accumulate unique accessors. 198 // Use a temporary FixedArray to accumulate unique accessors.
199 Handle<FixedArray> array = 199 Handle<FixedArray> array =
200 isolate->factory()->NewFixedArray(max_number_of_properties); 200 isolate->factory()->NewFixedArray(max_number_of_properties);
201 201
202 info = *data; 202 for (Handle<TemplateInfoT> temp(*data); *temp != nullptr;
203 while (info != nullptr) { 203 temp = handle(temp->GetParent(isolate), isolate)) {
204 // Accumulate accessors. 204 // Accumulate accessors.
205 Object* maybe_properties = info->property_accessors(); 205 Object* maybe_properties = temp->property_accessors();
206 if (!maybe_properties->IsUndefined(isolate)) { 206 if (!maybe_properties->IsUndefined(isolate)) {
207 valid_descriptors = AccessorInfo::AppendUnique( 207 valid_descriptors = AccessorInfo::AppendUnique(
208 handle(maybe_properties, isolate), array, valid_descriptors); 208 handle(maybe_properties, isolate), array, valid_descriptors);
209 } 209 }
210 info = info->GetParent(isolate);
211 } 210 }
212 211
213 // Install accumulated accessors. 212 // Install accumulated accessors.
214 for (int i = 0; i < valid_descriptors; i++) { 213 for (int i = 0; i < valid_descriptors; i++) {
215 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); 214 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i)));
216 JSObject::SetAccessor(obj, accessor).Assert(); 215 JSObject::SetAccessor(obj, accessor).Assert();
217 } 216 }
218 } 217 }
219 218
220 Object* maybe_property_list = data->property_list(); 219 Object* maybe_property_list = data->property_list();
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 if (!obj->instance_call_handler()->IsUndefined(isolate)) { 710 if (!obj->instance_call_handler()->IsUndefined(isolate)) {
712 map->set_is_callable(); 711 map->set_is_callable();
713 map->set_is_constructor(true); 712 map->set_is_constructor(true);
714 } 713 }
715 714
716 return result; 715 return result;
717 } 716 }
718 717
719 } // namespace internal 718 } // namespace internal
720 } // namespace v8 719 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698