| 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 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1876 | 1876 |
| 1877 | 1877 |
| 1878 void JSObject::LookupCallbackSetterInPrototypes(String* name, | 1878 void JSObject::LookupCallbackSetterInPrototypes(String* name, |
| 1879 LookupResult* result) { | 1879 LookupResult* result) { |
| 1880 Heap* heap = GetHeap(); | 1880 Heap* heap = GetHeap(); |
| 1881 for (Object* pt = GetPrototype(); | 1881 for (Object* pt = GetPrototype(); |
| 1882 pt != heap->null_value(); | 1882 pt != heap->null_value(); |
| 1883 pt = pt->GetPrototype()) { | 1883 pt = pt->GetPrototype()) { |
| 1884 JSObject::cast(pt)->LocalLookupRealNamedProperty(name, result); | 1884 JSObject::cast(pt)->LocalLookupRealNamedProperty(name, result); |
| 1885 if (result->IsProperty()) { | 1885 if (result->IsProperty()) { |
| 1886 if (result->IsReadOnly()) { | 1886 if (result->type() == CALLBACKS && !result->IsReadOnly()) return; |
| 1887 result->NotFound(); | 1887 // Found non-callback or read-only callback, stop looking. |
| 1888 return; | 1888 break; |
| 1889 } | |
| 1890 if (result->type() == CALLBACKS) { | |
| 1891 return; | |
| 1892 } | |
| 1893 } | 1889 } |
| 1894 } | 1890 } |
| 1895 result->NotFound(); | 1891 result->NotFound(); |
| 1896 } | 1892 } |
| 1897 | 1893 |
| 1898 | 1894 |
| 1899 MaybeObject* JSObject::SetElementWithCallbackSetterInPrototypes( | 1895 MaybeObject* JSObject::SetElementWithCallbackSetterInPrototypes( |
| 1900 uint32_t index, | 1896 uint32_t index, |
| 1901 Object* value, | 1897 Object* value, |
| 1902 bool* found, | 1898 bool* found, |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2266 Execution::Call(trap, handler, ARRAY_SIZE(args), args, has_exception); | 2262 Execution::Call(trap, handler, ARRAY_SIZE(args), args, has_exception); |
| 2267 if (has_exception) return NONE; | 2263 if (has_exception) return NONE; |
| 2268 | 2264 |
| 2269 // TODO(rossberg): convert result to PropertyAttributes | 2265 // TODO(rossberg): convert result to PropertyAttributes |
| 2270 USE(result); | 2266 USE(result); |
| 2271 return NONE; | 2267 return NONE; |
| 2272 } | 2268 } |
| 2273 | 2269 |
| 2274 | 2270 |
| 2275 MaybeObject* JSObject::SetPropertyForResult(LookupResult* result, | 2271 MaybeObject* JSObject::SetPropertyForResult(LookupResult* result, |
| 2276 String* name, | 2272 String* name, |
| 2277 Object* value, | 2273 Object* value, |
| 2278 PropertyAttributes attributes, | 2274 PropertyAttributes attributes, |
| 2279 StrictModeFlag strict_mode) { | 2275 StrictModeFlag strict_mode) { |
| 2280 Heap* heap = GetHeap(); | 2276 Heap* heap = GetHeap(); |
| 2281 // Make sure that the top context does not change when doing callbacks or | 2277 // Make sure that the top context does not change when doing callbacks or |
| 2282 // interceptor calls. | 2278 // interceptor calls. |
| 2283 AssertNoContextChange ncc; | 2279 AssertNoContextChange ncc; |
| 2284 | 2280 |
| 2285 // Optimization for 2-byte strings often used as keys in a decompression | 2281 // Optimization for 2-byte strings often used as keys in a decompression |
| 2286 // dictionary. We make these short keys into symbols to avoid constantly | 2282 // dictionary. We make these short keys into symbols to avoid constantly |
| 2287 // reallocating them. | 2283 // reallocating them. |
| 2288 if (!name->IsSymbol() && name->length() <= 2) { | 2284 if (!name->IsSymbol() && name->length() <= 2) { |
| 2289 Object* symbol_version; | 2285 Object* symbol_version; |
| (...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4115 // the map field of the array. | 4111 // the map field of the array. |
| 4116 Map* next = Map::cast(contents->get(i)); | 4112 Map* next = Map::cast(contents->get(i)); |
| 4117 next->set_map(current); | 4113 next->set_map(current); |
| 4118 *map_or_index_field = Smi::FromInt(i + 2); | 4114 *map_or_index_field = Smi::FromInt(i + 2); |
| 4119 current = next; | 4115 current = next; |
| 4120 map_done = false; | 4116 map_done = false; |
| 4121 break; | 4117 break; |
| 4122 } | 4118 } |
| 4123 } | 4119 } |
| 4124 if (!map_done) continue; | 4120 if (!map_done) continue; |
| 4121 } else { |
| 4122 map_or_index_field = NULL; |
| 4125 } | 4123 } |
| 4126 // That was the regular transitions, now for the prototype transitions. | 4124 // That was the regular transitions, now for the prototype transitions. |
| 4127 FixedArray* prototype_transitions = | 4125 FixedArray* prototype_transitions = |
| 4128 current->unchecked_prototype_transitions(); | 4126 current->unchecked_prototype_transitions(); |
| 4129 Object** proto_map_or_index_field = | 4127 Object** proto_map_or_index_field = |
| 4130 RawField(prototype_transitions, HeapObject::kMapOffset); | 4128 RawField(prototype_transitions, HeapObject::kMapOffset); |
| 4131 Object* map_or_index = *proto_map_or_index_field; | 4129 Object* map_or_index = *proto_map_or_index_field; |
| 4132 const int start = kProtoTransitionHeaderSize + kProtoTransitionMapOffset; | 4130 const int start = kProtoTransitionHeaderSize + kProtoTransitionMapOffset; |
| 4133 int i = map_or_index->IsSmi() ? Smi::cast(map_or_index)->value() : start; | 4131 int i = map_or_index->IsSmi() ? Smi::cast(map_or_index)->value() : start; |
| 4134 if (i < prototype_transitions->length()) { | 4132 if (i < prototype_transitions->length()) { |
| (...skipping 7556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11691 if (break_point_objects()->IsUndefined()) return 0; | 11689 if (break_point_objects()->IsUndefined()) return 0; |
| 11692 // Single beak point. | 11690 // Single beak point. |
| 11693 if (!break_point_objects()->IsFixedArray()) return 1; | 11691 if (!break_point_objects()->IsFixedArray()) return 1; |
| 11694 // Multiple break points. | 11692 // Multiple break points. |
| 11695 return FixedArray::cast(break_point_objects())->length(); | 11693 return FixedArray::cast(break_point_objects())->length(); |
| 11696 } | 11694 } |
| 11697 #endif | 11695 #endif |
| 11698 | 11696 |
| 11699 | 11697 |
| 11700 } } // namespace v8::internal | 11698 } } // namespace v8::internal |
| OLD | NEW |