Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: src/objects.cc

Issue 7324048: Fix a potential crash in const declaration. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-88591.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 9401 matching lines...) Expand 10 before | Expand all | Expand 10 after
11691 if (break_point_objects()->IsUndefined()) return 0; 11687 if (break_point_objects()->IsUndefined()) return 0;
11692 // Single beak point. 11688 // Single beak point.
11693 if (!break_point_objects()->IsFixedArray()) return 1; 11689 if (!break_point_objects()->IsFixedArray()) return 1;
11694 // Multiple break points. 11690 // Multiple break points.
11695 return FixedArray::cast(break_point_objects())->length(); 11691 return FixedArray::cast(break_point_objects())->length();
11696 } 11692 }
11697 #endif 11693 #endif
11698 11694
11699 11695
11700 } } // namespace v8::internal 11696 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-88591.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698