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

Side by Side Diff: src/objects.cc

Issue 3782009: Fix creation of an exception to avoid rare GC corner case. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 2 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-create-exception.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 6459 matching lines...) Expand 10 before | Expand all | Expand 10 after
6470 } else { 6470 } else {
6471 // Index not already used. Look for an accessor in the prototype chain. 6471 // Index not already used. Look for an accessor in the prototype chain.
6472 if (!IsJSArray()) { 6472 if (!IsJSArray()) {
6473 if (SetElementWithCallbackSetterInPrototypes(index, value)) { 6473 if (SetElementWithCallbackSetterInPrototypes(index, value)) {
6474 return value; 6474 return value;
6475 } 6475 }
6476 } 6476 }
6477 // When we set the is_extensible flag to false we always force 6477 // When we set the is_extensible flag to false we always force
6478 // the element into dictionary mode (and force them to stay there). 6478 // the element into dictionary mode (and force them to stay there).
6479 if (!map()->is_extensible()) { 6479 if (!map()->is_extensible()) {
6480 Handle<Object> number(Heap::NumberFromUint32(index)); 6480 Handle<Object> number(Factory::NewNumberFromUint(index));
6481 Handle<String> index_string(Factory::NumberToString(number)); 6481 Handle<String> index_string(Factory::NumberToString(number));
6482 Handle<Object> args[1] = { index_string }; 6482 Handle<Object> args[1] = { index_string };
6483 return Top::Throw(*Factory::NewTypeError("object_not_extensible", 6483 return Top::Throw(*Factory::NewTypeError("object_not_extensible",
6484 HandleVector(args, 1))); 6484 HandleVector(args, 1)));
6485 } 6485 }
6486 Object* result = dictionary->AtNumberPut(index, value); 6486 Object* result = dictionary->AtNumberPut(index, value);
6487 if (result->IsFailure()) return result; 6487 if (result->IsFailure()) return result;
6488 if (elms != FixedArray::cast(result)) { 6488 if (elms != FixedArray::cast(result)) {
6489 set_elements(FixedArray::cast(result)); 6489 set_elements(FixedArray::cast(result));
6490 } 6490 }
(...skipping 2569 matching lines...) Expand 10 before | Expand all | Expand 10 after
9060 if (break_point_objects()->IsUndefined()) return 0; 9060 if (break_point_objects()->IsUndefined()) return 0;
9061 // Single beak point. 9061 // Single beak point.
9062 if (!break_point_objects()->IsFixedArray()) return 1; 9062 if (!break_point_objects()->IsFixedArray()) return 1;
9063 // Multiple break points. 9063 // Multiple break points.
9064 return FixedArray::cast(break_point_objects())->length(); 9064 return FixedArray::cast(break_point_objects())->length();
9065 } 9065 }
9066 #endif 9066 #endif
9067 9067
9068 9068
9069 } } // namespace v8::internal 9069 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-create-exception.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698