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

Side by Side Diff: src/messages.cc

Issue 1938413002: [keys] Moving property/keys related methods to KeyAccumulator in keys.cc (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: nits 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/keys.cc ('k') | src/objects.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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/messages.h" 5 #include "src/messages.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/execution.h" 8 #include "src/execution.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/keys.h"
10 #include "src/string-builder.h" 11 #include "src/string-builder.h"
11 12
12 namespace v8 { 13 namespace v8 {
13 namespace internal { 14 namespace internal {
14 15
15 MessageLocation::MessageLocation(Handle<Script> script, int start_pos, 16 MessageLocation::MessageLocation(Handle<Script> script, int start_pos,
16 int end_pos) 17 int end_pos)
17 : script_(script), start_pos_(start_pos), end_pos_(end_pos) {} 18 : script_(script), start_pos_(start_pos), end_pos_(end_pos) {}
18 MessageLocation::MessageLocation(Handle<Script> script, int start_pos, 19 MessageLocation::MessageLocation(Handle<Script> script, int start_pos,
19 int end_pos, Handle<JSFunction> function) 20 int end_pos, Handle<JSFunction> function)
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 265
265 HandleScope outer_scope(isolate_); 266 HandleScope outer_scope(isolate_);
266 Handle<Object> result; 267 Handle<Object> result;
267 for (PrototypeIterator iter(isolate_, obj, 268 for (PrototypeIterator iter(isolate_, obj,
268 PrototypeIterator::START_AT_RECEIVER); 269 PrototypeIterator::START_AT_RECEIVER);
269 !iter.IsAtEnd(); iter.Advance()) { 270 !iter.IsAtEnd(); iter.Advance()) {
270 Handle<Object> current = PrototypeIterator::GetCurrent(iter); 271 Handle<Object> current = PrototypeIterator::GetCurrent(iter);
271 if (!current->IsJSObject()) break; 272 if (!current->IsJSObject()) break;
272 Handle<JSObject> current_obj = Handle<JSObject>::cast(current); 273 Handle<JSObject> current_obj = Handle<JSObject>::cast(current);
273 if (current_obj->IsAccessCheckNeeded()) break; 274 if (current_obj->IsAccessCheckNeeded()) break;
274 Handle<FixedArray> keys = JSObject::GetEnumPropertyKeys(current_obj); 275 Handle<FixedArray> keys =
276 KeyAccumulator::GetEnumPropertyKeys(isolate_, current_obj);
275 for (int i = 0; i < keys->length(); i++) { 277 for (int i = 0; i < keys->length(); i++) {
276 HandleScope inner_scope(isolate_); 278 HandleScope inner_scope(isolate_);
277 if (!keys->get(i)->IsName()) continue; 279 if (!keys->get(i)->IsName()) continue;
278 Handle<Name> name_key(Name::cast(keys->get(i)), isolate_); 280 Handle<Name> name_key(Name::cast(keys->get(i)), isolate_);
279 if (!CheckMethodName(isolate_, current_obj, name_key, fun_, 281 if (!CheckMethodName(isolate_, current_obj, name_key, fun_,
280 LookupIterator::OWN_SKIP_INTERCEPTOR)) 282 LookupIterator::OWN_SKIP_INTERCEPTOR))
281 continue; 283 continue;
282 // Return null in case of duplicates to avoid confusion. 284 // Return null in case of duplicates to avoid confusion.
283 if (!result.is_null()) return isolate_->factory()->null_value(); 285 if (!result.is_null()) return isolate_->factory()->null_value();
284 result = inner_scope.CloseAndEscape(name_key); 286 result = inner_scope.CloseAndEscape(name_key);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 builder.AppendCharacter(*c); 423 builder.AppendCharacter(*c);
422 } 424 }
423 } 425 }
424 426
425 return builder.Finish(); 427 return builder.Finish();
426 } 428 }
427 429
428 430
429 } // namespace internal 431 } // namespace internal
430 } // namespace v8 432 } // namespace v8
OLDNEW
« no previous file with comments | « src/keys.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698