OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 14717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14728 } | 14728 } |
14729 return object; | 14729 return object; |
14730 } | 14730 } |
14731 | 14731 |
14732 | 14732 |
14733 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsAccessAllowedForObserver) { | 14733 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsAccessAllowedForObserver) { |
14734 HandleScope scope(isolate); | 14734 HandleScope scope(isolate); |
14735 ASSERT(args.length() == 3); | 14735 ASSERT(args.length() == 3); |
14736 CONVERT_ARG_HANDLE_CHECKED(JSFunction, observer, 0); | 14736 CONVERT_ARG_HANDLE_CHECKED(JSFunction, observer, 0); |
14737 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 1); | 14737 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 1); |
14738 ASSERT(object->map()->is_access_check_needed()); | 14738 ASSERT(object->IsAccessCheckNeeded()); |
14739 Handle<Object> key = args.at<Object>(2); | 14739 Handle<Object> key = args.at<Object>(2); |
14740 SaveContext save(isolate); | 14740 SaveContext save(isolate); |
14741 isolate->set_context(observer->context()); | 14741 isolate->set_context(observer->context()); |
14742 if (!isolate->MayNamedAccess(*object, isolate->heap()->undefined_value(), | 14742 if (!isolate->MayNamedAccess(*object, isolate->heap()->undefined_value(), |
14743 v8::ACCESS_KEYS)) { | 14743 v8::ACCESS_KEYS)) { |
14744 return isolate->heap()->false_value(); | 14744 return isolate->heap()->false_value(); |
14745 } | 14745 } |
14746 bool access_allowed = false; | 14746 bool access_allowed = false; |
14747 uint32_t index = 0; | 14747 uint32_t index = 0; |
14748 if (key->ToArrayIndex(&index) || | 14748 if (key->ToArrayIndex(&index) || |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14965 // Handle last resort GC and make sure to allow future allocations | 14965 // Handle last resort GC and make sure to allow future allocations |
14966 // to grow the heap without causing GCs (if possible). | 14966 // to grow the heap without causing GCs (if possible). |
14967 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14967 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14968 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14968 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14969 "Runtime::PerformGC"); | 14969 "Runtime::PerformGC"); |
14970 } | 14970 } |
14971 } | 14971 } |
14972 | 14972 |
14973 | 14973 |
14974 } } // namespace v8::internal | 14974 } } // namespace v8::internal |
OLD | NEW |