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 14849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14860 // isolate. If it's called more often, the map should be moved into the | 14860 // isolate. If it's called more often, the map should be moved into the |
14861 // strong root list. | 14861 // strong root list. |
14862 Handle<Map> map = | 14862 Handle<Map> map = |
14863 isolate->factory()->NewMap(JS_WEAK_MAP_TYPE, JSWeakMap::kSize); | 14863 isolate->factory()->NewMap(JS_WEAK_MAP_TYPE, JSWeakMap::kSize); |
14864 Handle<JSWeakMap> weakmap = | 14864 Handle<JSWeakMap> weakmap = |
14865 Handle<JSWeakMap>::cast(isolate->factory()->NewJSObjectFromMap(map)); | 14865 Handle<JSWeakMap>::cast(isolate->factory()->NewJSObjectFromMap(map)); |
14866 return *WeakCollectionInitialize(isolate, weakmap); | 14866 return *WeakCollectionInitialize(isolate, weakmap); |
14867 } | 14867 } |
14868 | 14868 |
14869 | 14869 |
| 14870 RUNTIME_FUNCTION(Runtime_UnwrapGlobalProxy) { |
| 14871 SealHandleScope shs(isolate); |
| 14872 ASSERT(args.length() == 1); |
| 14873 Object* object = args[0]; |
| 14874 if (object->IsJSGlobalProxy()) { |
| 14875 object = object->GetPrototype(isolate); |
| 14876 if (object->IsNull()) return isolate->heap()->undefined_value(); |
| 14877 } |
| 14878 return object; |
| 14879 } |
| 14880 |
| 14881 |
14870 RUNTIME_FUNCTION(Runtime_IsAccessAllowedForObserver) { | 14882 RUNTIME_FUNCTION(Runtime_IsAccessAllowedForObserver) { |
14871 HandleScope scope(isolate); | 14883 HandleScope scope(isolate); |
14872 ASSERT(args.length() == 3); | 14884 ASSERT(args.length() == 3); |
14873 CONVERT_ARG_HANDLE_CHECKED(JSFunction, observer, 0); | 14885 CONVERT_ARG_HANDLE_CHECKED(JSFunction, observer, 0); |
14874 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 1); | 14886 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 1); |
14875 ASSERT(object->map()->is_access_check_needed()); | 14887 ASSERT(object->map()->is_access_check_needed()); |
14876 CONVERT_ARG_HANDLE_CHECKED(Object, key, 2); | 14888 CONVERT_ARG_HANDLE_CHECKED(Object, key, 2); |
14877 SaveContext save(isolate); | 14889 SaveContext save(isolate); |
14878 isolate->set_context(observer->context()); | 14890 isolate->set_context(observer->context()); |
14879 if (!isolate->MayNamedAccess( | 14891 if (!isolate->MayNamedAccess( |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15104 } | 15116 } |
15105 return NULL; | 15117 return NULL; |
15106 } | 15118 } |
15107 | 15119 |
15108 | 15120 |
15109 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15121 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15110 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15122 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15111 } | 15123 } |
15112 | 15124 |
15113 } } // namespace v8::internal | 15125 } } // namespace v8::internal |
OLD | NEW |