OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 } | 1799 } |
1800 break; | 1800 break; |
1801 } | 1801 } |
1802 default: { | 1802 default: { |
1803 break; | 1803 break; |
1804 } | 1804 } |
1805 } | 1805 } |
1806 } | 1806 } |
1807 } | 1807 } |
1808 | 1808 |
| 1809 HandleScope scope; |
| 1810 Handle<Object> value_handle(value); |
1809 Top::ReportFailedAccessCheck(this, v8::ACCESS_SET); | 1811 Top::ReportFailedAccessCheck(this, v8::ACCESS_SET); |
1810 return value; | 1812 return *value_handle; |
1811 } | 1813 } |
1812 | 1814 |
1813 | 1815 |
1814 Object* JSObject::SetProperty(LookupResult* result, | 1816 Object* JSObject::SetProperty(LookupResult* result, |
1815 String* name, | 1817 String* name, |
1816 Object* value, | 1818 Object* value, |
1817 PropertyAttributes attributes) { | 1819 PropertyAttributes attributes) { |
1818 // Make sure that the top context does not change when doing callbacks or | 1820 // Make sure that the top context does not change when doing callbacks or |
1819 // interceptor calls. | 1821 // interceptor calls. |
1820 AssertNoContextChange ncc; | 1822 AssertNoContextChange ncc; |
(...skipping 4262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6083 Object* obj = NormalizeElements(); | 6085 Object* obj = NormalizeElements(); |
6084 if (obj->IsFailure()) return obj; | 6086 if (obj->IsFailure()) return obj; |
6085 ASSERT(HasDictionaryElements()); | 6087 ASSERT(HasDictionaryElements()); |
6086 return SetElement(index, value); | 6088 return SetElement(index, value); |
6087 } | 6089 } |
6088 | 6090 |
6089 Object* JSObject::SetElement(uint32_t index, Object* value) { | 6091 Object* JSObject::SetElement(uint32_t index, Object* value) { |
6090 // Check access rights if needed. | 6092 // Check access rights if needed. |
6091 if (IsAccessCheckNeeded() && | 6093 if (IsAccessCheckNeeded() && |
6092 !Top::MayIndexedAccess(this, index, v8::ACCESS_SET)) { | 6094 !Top::MayIndexedAccess(this, index, v8::ACCESS_SET)) { |
| 6095 HandleScope scope; |
| 6096 Handle<Object> value_handle(value); |
6093 Top::ReportFailedAccessCheck(this, v8::ACCESS_SET); | 6097 Top::ReportFailedAccessCheck(this, v8::ACCESS_SET); |
6094 return value; | 6098 return *value_handle; |
6095 } | 6099 } |
6096 | 6100 |
6097 if (IsJSGlobalProxy()) { | 6101 if (IsJSGlobalProxy()) { |
6098 Object* proto = GetPrototype(); | 6102 Object* proto = GetPrototype(); |
6099 if (proto->IsNull()) return value; | 6103 if (proto->IsNull()) return value; |
6100 ASSERT(proto->IsJSGlobalObject()); | 6104 ASSERT(proto->IsJSGlobalObject()); |
6101 return JSObject::cast(proto)->SetElement(index, value); | 6105 return JSObject::cast(proto)->SetElement(index, value); |
6102 } | 6106 } |
6103 | 6107 |
6104 // Check for lookup interceptor | 6108 // Check for lookup interceptor |
(...skipping 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8750 if (break_point_objects()->IsUndefined()) return 0; | 8754 if (break_point_objects()->IsUndefined()) return 0; |
8751 // Single beak point. | 8755 // Single beak point. |
8752 if (!break_point_objects()->IsFixedArray()) return 1; | 8756 if (!break_point_objects()->IsFixedArray()) return 1; |
8753 // Multiple break points. | 8757 // Multiple break points. |
8754 return FixedArray::cast(break_point_objects())->length(); | 8758 return FixedArray::cast(break_point_objects())->length(); |
8755 } | 8759 } |
8756 #endif | 8760 #endif |
8757 | 8761 |
8758 | 8762 |
8759 } } // namespace v8::internal | 8763 } } // namespace v8::internal |
OLD | NEW |