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

Side by Side Diff: src/runtime/runtime-classes.cc

Issue 1431443003: Refactor Object::SetSuperProperty and others. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Revert unintended change to test262 status file. Created 5 years, 1 month 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-inl.h ('k') | src/runtime/runtime-object.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <limits> 8 #include <limits>
9 9
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 !isolate->MayAccess(handle(isolate->context()), home_object)) { 374 !isolate->MayAccess(handle(isolate->context()), home_object)) {
375 isolate->ReportFailedAccessCheck(home_object); 375 isolate->ReportFailedAccessCheck(home_object);
376 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); 376 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
377 } 377 }
378 378
379 PrototypeIterator iter(isolate, home_object); 379 PrototypeIterator iter(isolate, home_object);
380 Handle<Object> proto = PrototypeIterator::GetCurrent(iter); 380 Handle<Object> proto = PrototypeIterator::GetCurrent(iter);
381 if (!proto->IsJSReceiver()) return isolate->heap()->undefined_value(); 381 if (!proto->IsJSReceiver()) return isolate->heap()->undefined_value();
382 382
383 LookupIterator it(receiver, name, Handle<JSReceiver>::cast(proto)); 383 LookupIterator it(receiver, name, Handle<JSReceiver>::cast(proto));
384 Handle<Object> result; 384 MAYBE_RETURN(Object::SetSuperProperty(&it, value, language_mode,
385 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 385 Object::CERTAINLY_NOT_STORE_FROM_KEYED),
386 isolate, result, 386 isolate->heap()->exception());
387 Object::SetSuperProperty(&it, value, language_mode, 387 return *value;
388 Object::CERTAINLY_NOT_STORE_FROM_KEYED));
389 return *result;
390 } 388 }
391 389
392 390
393 static Object* StoreElementToSuper(Isolate* isolate, 391 static Object* StoreElementToSuper(Isolate* isolate,
394 Handle<JSObject> home_object, 392 Handle<JSObject> home_object,
395 Handle<Object> receiver, uint32_t index, 393 Handle<Object> receiver, uint32_t index,
396 Handle<Object> value, 394 Handle<Object> value,
397 LanguageMode language_mode) { 395 LanguageMode language_mode) {
398 if (home_object->IsAccessCheckNeeded() && 396 if (home_object->IsAccessCheckNeeded() &&
399 !isolate->MayAccess(handle(isolate->context()), home_object)) { 397 !isolate->MayAccess(handle(isolate->context()), home_object)) {
400 isolate->ReportFailedAccessCheck(home_object); 398 isolate->ReportFailedAccessCheck(home_object);
401 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); 399 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
402 } 400 }
403 401
404 PrototypeIterator iter(isolate, home_object); 402 PrototypeIterator iter(isolate, home_object);
405 Handle<Object> proto = PrototypeIterator::GetCurrent(iter); 403 Handle<Object> proto = PrototypeIterator::GetCurrent(iter);
406 if (!proto->IsJSReceiver()) return isolate->heap()->undefined_value(); 404 if (!proto->IsJSReceiver()) return isolate->heap()->undefined_value();
407 405
408 LookupIterator it(isolate, receiver, index, Handle<JSReceiver>::cast(proto)); 406 LookupIterator it(isolate, receiver, index, Handle<JSReceiver>::cast(proto));
409 Handle<Object> result; 407 MAYBE_RETURN(Object::SetSuperProperty(&it, value, language_mode,
410 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 408 Object::MAY_BE_STORE_FROM_KEYED),
411 isolate, result, 409 isolate->heap()->exception());
412 Object::SetSuperProperty(&it, value, language_mode, 410 return *value;
413 Object::MAY_BE_STORE_FROM_KEYED));
414 return *result;
415 } 411 }
416 412
417 413
418 RUNTIME_FUNCTION(Runtime_StoreToSuper_Strict) { 414 RUNTIME_FUNCTION(Runtime_StoreToSuper_Strict) {
419 HandleScope scope(isolate); 415 HandleScope scope(isolate);
420 DCHECK(args.length() == 4); 416 DCHECK(args.length() == 4);
421 CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0); 417 CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0);
422 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1); 418 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1);
423 CONVERT_ARG_HANDLE_CHECKED(Name, name, 2); 419 CONVERT_ARG_HANDLE_CHECKED(Name, name, 2);
424 CONVERT_ARG_HANDLE_CHECKED(Object, value, 3); 420 CONVERT_ARG_HANDLE_CHECKED(Object, value, 3);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 509 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
514 isolate, result, 510 isolate, result,
515 Execution::New(isolate, super_constructor, original_constructor, 511 Execution::New(isolate, super_constructor, original_constructor,
516 argument_count, arguments.get())); 512 argument_count, arguments.get()));
517 513
518 return *result; 514 return *result;
519 } 515 }
520 516
521 } // namespace internal 517 } // namespace internal
522 } // namespace v8 518 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698