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

Side by Side Diff: src/top.cc

Issue 271080: Skip access checks for hidden properties. (Closed)
Patch Set: Created 11 years, 2 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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 global_context->security_token()) 487 global_context->security_token())
488 return YES; 488 return YES;
489 } 489 }
490 490
491 return UNKNOWN; 491 return UNKNOWN;
492 } 492 }
493 493
494 494
495 bool Top::MayNamedAccess(JSObject* receiver, Object* key, v8::AccessType type) { 495 bool Top::MayNamedAccess(JSObject* receiver, Object* key, v8::AccessType type) {
496 ASSERT(receiver->IsAccessCheckNeeded()); 496 ASSERT(receiver->IsAccessCheckNeeded());
497
498 // The callers of this method are not expecting a GC.
499 AssertNoAllocation no_gc;
500
501 // Skip checks for hidden properties access. Note, we do not
502 // require existence of a context in this case.
503 if (key == Heap::hidden_symbol()) return true;
504
497 // Check for compatibility between the security tokens in the 505 // Check for compatibility between the security tokens in the
498 // current lexical context and the accessed object. 506 // current lexical context and the accessed object.
499 ASSERT(Top::context()); 507 ASSERT(Top::context());
500 // The callers of this method are not expecting a GC.
501 AssertNoAllocation no_gc;
502 508
503 MayAccessDecision decision = MayAccessPreCheck(receiver, type); 509 MayAccessDecision decision = MayAccessPreCheck(receiver, type);
504 if (decision != UNKNOWN) return decision == YES; 510 if (decision != UNKNOWN) return decision == YES;
505 511
506 // Get named access check callback 512 // Get named access check callback
507 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor()); 513 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor());
508 Object* info = constructor->shared()->function_data(); 514 Object* info = constructor->shared()->function_data();
509 if (info == Heap::undefined_value()) return false; 515 if (info == Heap::undefined_value()) return false;
510 516
511 Object* data_obj = FunctionTemplateInfo::cast(info)->access_check_info(); 517 Object* data_obj = FunctionTemplateInfo::cast(info)->access_check_info();
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 Top::break_access_->Lock(); 981 Top::break_access_->Lock();
976 } 982 }
977 983
978 984
979 ExecutionAccess::~ExecutionAccess() { 985 ExecutionAccess::~ExecutionAccess() {
980 Top::break_access_->Unlock(); 986 Top::break_access_->Unlock();
981 } 987 }
982 988
983 989
984 } } // namespace v8::internal 990 } } // namespace v8::internal
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