OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |