| 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 3042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3053 | 3053 |
| 3054 Local<Array> v8::Object::GetPropertyNames() { | 3054 Local<Array> v8::Object::GetPropertyNames() { |
| 3055 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3055 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3056 ON_BAILOUT(isolate, "v8::Object::GetPropertyNames()", | 3056 ON_BAILOUT(isolate, "v8::Object::GetPropertyNames()", |
| 3057 return Local<v8::Array>()); | 3057 return Local<v8::Array>()); |
| 3058 ENTER_V8(isolate); | 3058 ENTER_V8(isolate); |
| 3059 i::HandleScope scope(isolate); | 3059 i::HandleScope scope(isolate); |
| 3060 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3060 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 3061 bool threw = false; | 3061 bool threw = false; |
| 3062 i::Handle<i::FixedArray> value = | 3062 i::Handle<i::FixedArray> value = |
| 3063 i::GetKeysInFixedArrayFor(self, i::INCLUDE_PROTOS, &threw); | 3063 i::GetKeysInFixedArrayFor<true>(self, i::INCLUDE_PROTOS, &threw); |
| 3064 if (threw) return Local<v8::Array>(); | 3064 if (threw) return Local<v8::Array>(); |
| 3065 // Because we use caching to speed up enumeration it is important | 3065 // Because we use caching to speed up enumeration it is important |
| 3066 // to never change the result of the basic enumeration function so | 3066 // to never change the result of the basic enumeration function so |
| 3067 // we clone the result. | 3067 // we clone the result. |
| 3068 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value); | 3068 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value); |
| 3069 i::Handle<i::JSArray> result = | 3069 i::Handle<i::JSArray> result = |
| 3070 isolate->factory()->NewJSArrayWithElements(elms); | 3070 isolate->factory()->NewJSArrayWithElements(elms); |
| 3071 return Utils::ToLocal(scope.CloseAndEscape(result)); | 3071 return Utils::ToLocal(scope.CloseAndEscape(result)); |
| 3072 } | 3072 } |
| 3073 | 3073 |
| 3074 | 3074 |
| 3075 Local<Array> v8::Object::GetOwnPropertyNames() { | 3075 Local<Array> v8::Object::GetOwnPropertyNames() { |
| 3076 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3076 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3077 ON_BAILOUT(isolate, "v8::Object::GetOwnPropertyNames()", | 3077 ON_BAILOUT(isolate, "v8::Object::GetOwnPropertyNames()", |
| 3078 return Local<v8::Array>()); | 3078 return Local<v8::Array>()); |
| 3079 ENTER_V8(isolate); | 3079 ENTER_V8(isolate); |
| 3080 i::HandleScope scope(isolate); | 3080 i::HandleScope scope(isolate); |
| 3081 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3081 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 3082 bool threw = false; | 3082 bool threw = false; |
| 3083 i::Handle<i::FixedArray> value = | 3083 i::Handle<i::FixedArray> value = |
| 3084 i::GetKeysInFixedArrayFor(self, i::LOCAL_ONLY, &threw); | 3084 i::GetKeysInFixedArrayFor<true>(self, i::LOCAL_ONLY, &threw); |
| 3085 if (threw) return Local<v8::Array>(); | 3085 if (threw) return Local<v8::Array>(); |
| 3086 // Because we use caching to speed up enumeration it is important | 3086 // Because we use caching to speed up enumeration it is important |
| 3087 // to never change the result of the basic enumeration function so | 3087 // to never change the result of the basic enumeration function so |
| 3088 // we clone the result. | 3088 // we clone the result. |
| 3089 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value); | 3089 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value); |
| 3090 i::Handle<i::JSArray> result = | 3090 i::Handle<i::JSArray> result = |
| 3091 isolate->factory()->NewJSArrayWithElements(elms); | 3091 isolate->factory()->NewJSArrayWithElements(elms); |
| 3092 return Utils::ToLocal(scope.CloseAndEscape(result)); | 3092 return Utils::ToLocal(scope.CloseAndEscape(result)); |
| 3093 } | 3093 } |
| 3094 | 3094 |
| (...skipping 3646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6741 | 6741 |
| 6742 v->VisitPointers(blocks_.first(), first_block_limit_); | 6742 v->VisitPointers(blocks_.first(), first_block_limit_); |
| 6743 | 6743 |
| 6744 for (int i = 1; i < blocks_.length(); i++) { | 6744 for (int i = 1; i < blocks_.length(); i++) { |
| 6745 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 6745 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
| 6746 } | 6746 } |
| 6747 } | 6747 } |
| 6748 | 6748 |
| 6749 | 6749 |
| 6750 } } // namespace v8::internal | 6750 } } // namespace v8::internal |
| OLD | NEW |