| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 // Computes the enumerable keys from interceptors. Used for debug mirrors and | 271 // Computes the enumerable keys from interceptors. Used for debug mirrors and |
| 272 // by GetKeysInFixedArrayFor below. | 272 // by GetKeysInFixedArrayFor below. |
| 273 v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSReceiver> receiver, | 273 v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSReceiver> receiver, |
| 274 Handle<JSObject> object); | 274 Handle<JSObject> object); |
| 275 v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSReceiver> receiver, | 275 v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSReceiver> receiver, |
| 276 Handle<JSObject> object); | 276 Handle<JSObject> object); |
| 277 | 277 |
| 278 enum KeyCollectionType { LOCAL_ONLY, INCLUDE_PROTOS }; | 278 enum KeyCollectionType { LOCAL_ONLY, INCLUDE_PROTOS }; |
| 279 | 279 |
| 280 // Computes the enumerable keys for a JSObject. Used for implementing | 280 // Computes the enumerable keys for a JSObject. Used for implementing |
| 281 // "for (n in object) { }". | 281 // "for (n in object) { }". The side-effect free version omits getting keys |
| 282 // if it would trigger side effects. |
| 283 template<bool allow_side_effect> |
| 282 Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSReceiver> object, | 284 Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSReceiver> object, |
| 283 KeyCollectionType type, | 285 KeyCollectionType type, |
| 284 bool* threw); | 286 bool* threw); |
| 285 Handle<JSArray> GetKeysFor(Handle<JSReceiver> object, bool* threw); | |
| 286 Handle<FixedArray> ReduceFixedArrayTo(Handle<FixedArray> array, int length); | 287 Handle<FixedArray> ReduceFixedArrayTo(Handle<FixedArray> array, int length); |
| 287 Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object, | 288 Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object, |
| 288 bool cache_result); | 289 bool cache_result); |
| 289 | 290 |
| 290 // Computes the union of keys and return the result. | 291 // Computes the union of keys and return the result. |
| 291 // Used for implementing "for (n in object) { }" | 292 // Used for implementing "for (n in object) { }" |
| 292 Handle<FixedArray> UnionOfKeys(Handle<FixedArray> first, | 293 Handle<FixedArray> UnionOfKeys(Handle<FixedArray> first, |
| 293 Handle<FixedArray> second); | 294 Handle<FixedArray> second); |
| 294 | 295 |
| 295 Handle<String> SubString(Handle<String> str, | 296 Handle<String> SubString(Handle<String> str, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 inline ~NoHandleAllocation(); | 336 inline ~NoHandleAllocation(); |
| 336 private: | 337 private: |
| 337 int level_; | 338 int level_; |
| 338 bool active_; | 339 bool active_; |
| 339 #endif | 340 #endif |
| 340 }; | 341 }; |
| 341 | 342 |
| 342 } } // namespace v8::internal | 343 } } // namespace v8::internal |
| 343 | 344 |
| 344 #endif // V8_HANDLES_H_ | 345 #endif // V8_HANDLES_H_ |
| OLD | NEW |