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 3006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3017 // in the prototype chain. | 3017 // in the prototype chain. |
3018 if (!obj->HasHiddenPropertiesObject()) { | 3018 if (!obj->HasHiddenPropertiesObject()) { |
3019 // Hidden properties object not found. Allocate a new hidden properties | 3019 // Hidden properties object not found. Allocate a new hidden properties |
3020 // object if requested. Otherwise return the undefined value. | 3020 // object if requested. Otherwise return the undefined value. |
3021 if (flag == ALLOW_CREATION) { | 3021 if (flag == ALLOW_CREATION) { |
3022 Object* hidden_obj; | 3022 Object* hidden_obj; |
3023 { MaybeObject* maybe_obj = heap->AllocateJSObject( | 3023 { MaybeObject* maybe_obj = heap->AllocateJSObject( |
3024 isolate->context()->global_context()->object_function()); | 3024 isolate->context()->global_context()->object_function()); |
3025 if (!maybe_obj->ToObject(&hidden_obj)) return maybe_obj; | 3025 if (!maybe_obj->ToObject(&hidden_obj)) return maybe_obj; |
3026 } | 3026 } |
| 3027 // Don't allow leakage of the hidden object through accessors |
| 3028 // on Object.prototype. |
| 3029 { |
| 3030 MaybeObject* maybe_obj = |
| 3031 JSObject::cast(hidden_obj)->SetPrototype(heap->null_value(), false); |
| 3032 if (maybe_obj->IsFailure()) return maybe_obj; |
| 3033 } |
3027 return obj->SetHiddenPropertiesObject(hidden_obj); | 3034 return obj->SetHiddenPropertiesObject(hidden_obj); |
3028 } else { | 3035 } else { |
3029 return heap->undefined_value(); | 3036 return heap->undefined_value(); |
3030 } | 3037 } |
3031 } | 3038 } |
3032 return obj->GetHiddenPropertiesObject(); | 3039 return obj->GetHiddenPropertiesObject(); |
3033 } | 3040 } |
3034 | 3041 |
3035 | 3042 |
3036 MaybeObject* JSObject::GetIdentityHash(HiddenPropertiesFlag flag) { | 3043 MaybeObject* JSObject::GetIdentityHash(HiddenPropertiesFlag flag) { |
(...skipping 8554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11591 if (break_point_objects()->IsUndefined()) return 0; | 11598 if (break_point_objects()->IsUndefined()) return 0; |
11592 // Single break point. | 11599 // Single break point. |
11593 if (!break_point_objects()->IsFixedArray()) return 1; | 11600 if (!break_point_objects()->IsFixedArray()) return 1; |
11594 // Multiple break points. | 11601 // Multiple break points. |
11595 return FixedArray::cast(break_point_objects())->length(); | 11602 return FixedArray::cast(break_point_objects())->length(); |
11596 } | 11603 } |
11597 #endif | 11604 #endif |
11598 | 11605 |
11599 | 11606 |
11600 } } // namespace v8::internal | 11607 } } // namespace v8::internal |
OLD | NEW |