Simplify {Enable|Disable}AccessCheck

BUG=
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/334243003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21919 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
verwaest@chromium.org 2014-06-23 09:04:17 +00:00
parent d06afb3ce0
commit 702167b107

View File

@ -2126,11 +2126,7 @@ RUNTIME_FUNCTION(Runtime_DisableAccessChecks) {
// Copy map so it won't interfere constructor's initial map.
Handle<Map> new_map = Map::Copy(old_map);
new_map->set_is_access_check_needed(false);
if (object->IsJSObject()) {
JSObject::MigrateToMap(Handle<JSObject>::cast(object), new_map);
} else {
object->set_map(*new_map);
}
JSObject::MigrateToMap(Handle<JSObject>::cast(object), new_map);
}
return isolate->heap()->ToBoolean(needs_access_checks);
}
@ -2141,16 +2137,11 @@ RUNTIME_FUNCTION(Runtime_EnableAccessChecks) {
ASSERT(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(HeapObject, object, 0);
Handle<Map> old_map(object->map());
if (!old_map->is_access_check_needed()) {
// Copy map so it won't interfere constructor's initial map.
Handle<Map> new_map = Map::Copy(old_map);
new_map->set_is_access_check_needed(true);
if (object->IsJSObject()) {
JSObject::MigrateToMap(Handle<JSObject>::cast(object), new_map);
} else {
object->set_map(*new_map);
}
}
ASSERT(!old_map->is_access_check_needed());
// Copy map so it won't interfere constructor's initial map.
Handle<Map> new_map = Map::Copy(old_map);
new_map->set_is_access_check_needed(true);
JSObject::MigrateToMap(Handle<JSObject>::cast(object), new_map);
return isolate->heap()->undefined_value();
}