OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 } | 2867 } |
2868 | 2868 |
2869 | 2869 |
2870 Local<Array> v8::Object::GetPropertyNames() { | 2870 Local<Array> v8::Object::GetPropertyNames() { |
2871 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2871 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2872 ON_BAILOUT(isolate, "v8::Object::GetPropertyNames()", | 2872 ON_BAILOUT(isolate, "v8::Object::GetPropertyNames()", |
2873 return Local<v8::Array>()); | 2873 return Local<v8::Array>()); |
2874 ENTER_V8(isolate); | 2874 ENTER_V8(isolate); |
2875 i::HandleScope scope(isolate); | 2875 i::HandleScope scope(isolate); |
2876 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2876 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2877 bool threw = false; |
2877 i::Handle<i::FixedArray> value = | 2878 i::Handle<i::FixedArray> value = |
2878 i::GetKeysInFixedArrayFor(self, i::INCLUDE_PROTOS); | 2879 i::GetKeysInFixedArrayFor(self, i::INCLUDE_PROTOS, &threw); |
| 2880 if (threw) return Local<v8::Array>(); |
2879 // Because we use caching to speed up enumeration it is important | 2881 // Because we use caching to speed up enumeration it is important |
2880 // to never change the result of the basic enumeration function so | 2882 // to never change the result of the basic enumeration function so |
2881 // we clone the result. | 2883 // we clone the result. |
2882 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value); | 2884 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value); |
2883 i::Handle<i::JSArray> result = | 2885 i::Handle<i::JSArray> result = |
2884 isolate->factory()->NewJSArrayWithElements(elms); | 2886 isolate->factory()->NewJSArrayWithElements(elms); |
2885 return Utils::ToLocal(scope.CloseAndEscape(result)); | 2887 return Utils::ToLocal(scope.CloseAndEscape(result)); |
2886 } | 2888 } |
2887 | 2889 |
2888 | 2890 |
2889 Local<Array> v8::Object::GetOwnPropertyNames() { | 2891 Local<Array> v8::Object::GetOwnPropertyNames() { |
2890 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2892 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2891 ON_BAILOUT(isolate, "v8::Object::GetOwnPropertyNames()", | 2893 ON_BAILOUT(isolate, "v8::Object::GetOwnPropertyNames()", |
2892 return Local<v8::Array>()); | 2894 return Local<v8::Array>()); |
2893 ENTER_V8(isolate); | 2895 ENTER_V8(isolate); |
2894 i::HandleScope scope(isolate); | 2896 i::HandleScope scope(isolate); |
2895 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2897 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2898 bool threw = false; |
2896 i::Handle<i::FixedArray> value = | 2899 i::Handle<i::FixedArray> value = |
2897 i::GetKeysInFixedArrayFor(self, i::LOCAL_ONLY); | 2900 i::GetKeysInFixedArrayFor(self, i::LOCAL_ONLY, &threw); |
| 2901 if (threw) return Local<v8::Array>(); |
2898 // Because we use caching to speed up enumeration it is important | 2902 // Because we use caching to speed up enumeration it is important |
2899 // to never change the result of the basic enumeration function so | 2903 // to never change the result of the basic enumeration function so |
2900 // we clone the result. | 2904 // we clone the result. |
2901 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value); | 2905 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value); |
2902 i::Handle<i::JSArray> result = | 2906 i::Handle<i::JSArray> result = |
2903 isolate->factory()->NewJSArrayWithElements(elms); | 2907 isolate->factory()->NewJSArrayWithElements(elms); |
2904 return Utils::ToLocal(scope.CloseAndEscape(result)); | 2908 return Utils::ToLocal(scope.CloseAndEscape(result)); |
2905 } | 2909 } |
2906 | 2910 |
2907 | 2911 |
(...skipping 3157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6065 | 6069 |
6066 | 6070 |
6067 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 6071 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
6068 HandleScopeImplementer* scope_implementer = | 6072 HandleScopeImplementer* scope_implementer = |
6069 reinterpret_cast<HandleScopeImplementer*>(storage); | 6073 reinterpret_cast<HandleScopeImplementer*>(storage); |
6070 scope_implementer->IterateThis(v); | 6074 scope_implementer->IterateThis(v); |
6071 return storage + ArchiveSpacePerThread(); | 6075 return storage + ArchiveSpacePerThread(); |
6072 } | 6076 } |
6073 | 6077 |
6074 } } // namespace v8::internal | 6078 } } // namespace v8::internal |
OLD | NEW |