OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1940 } else { | 1940 } else { |
1941 int byte_array_length = ByteArray::LengthFor(instance_size_delta); | 1941 int byte_array_length = ByteArray::LengthFor(instance_size_delta); |
1942 int byte_array_length_offset = new_instance_size + kPointerSize; | 1942 int byte_array_length_offset = new_instance_size + kPointerSize; |
1943 WRITE_FIELD(this, new_instance_size, Heap::byte_array_map()); | 1943 WRITE_FIELD(this, new_instance_size, Heap::byte_array_map()); |
1944 WRITE_INT_FIELD(this, byte_array_length_offset, byte_array_length); | 1944 WRITE_INT_FIELD(this, byte_array_length_offset, byte_array_length); |
1945 } | 1945 } |
1946 WRITE_BARRIER(this, new_instance_size); | 1946 WRITE_BARRIER(this, new_instance_size); |
1947 } | 1947 } |
1948 new_map->set_unused_property_fields(0); | 1948 new_map->set_unused_property_fields(0); |
1949 | 1949 |
1950 // We have now sucessfully allocated all the necessary objects. | 1950 // We have now successfully allocated all the necessary objects. |
1951 // Changes can now be made with the guarantee that all of them take effect. | 1951 // Changes can now be made with the guarantee that all of them take effect. |
1952 set_map(new_map); | 1952 set_map(new_map); |
1953 map()->set_instance_descriptors(Heap::empty_descriptor_array()); | 1953 map()->set_instance_descriptors(Heap::empty_descriptor_array()); |
1954 | 1954 |
1955 set_properties(dictionary); | 1955 set_properties(dictionary); |
1956 | 1956 |
1957 Counters::props_to_dictionary.Increment(); | 1957 Counters::props_to_dictionary.Increment(); |
1958 | 1958 |
1959 #ifdef DEBUG | 1959 #ifdef DEBUG |
1960 if (FLAG_trace_normalization) { | 1960 if (FLAG_trace_normalization) { |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2417 name->TryFlatten(StringShape(name)); | 2417 name->TryFlatten(StringShape(name)); |
2418 | 2418 |
2419 // Make sure name is not an index. | 2419 // Make sure name is not an index. |
2420 uint32_t index; | 2420 uint32_t index; |
2421 if (name->AsArrayIndex(&index)) return Heap::undefined_value(); | 2421 if (name->AsArrayIndex(&index)) return Heap::undefined_value(); |
2422 | 2422 |
2423 // Check if there is an API defined callback object which prohibits | 2423 // Check if there is an API defined callback object which prohibits |
2424 // callback overwriting in this object or it's prototype chain. | 2424 // callback overwriting in this object or it's prototype chain. |
2425 // This mechanism is needed for instance in a browser setting, where | 2425 // This mechanism is needed for instance in a browser setting, where |
2426 // certain accessors such as window.location should not be allowed | 2426 // certain accessors such as window.location should not be allowed |
2427 // to be overwriten because allowing overwriting could potentially | 2427 // to be overwritten because allowing overwriting could potentially |
2428 // cause security problems. | 2428 // cause security problems. |
2429 LookupResult callback_result; | 2429 LookupResult callback_result; |
2430 LookupCallback(name, &callback_result); | 2430 LookupCallback(name, &callback_result); |
2431 if (callback_result.IsValid()) { | 2431 if (callback_result.IsValid()) { |
2432 Object* obj = callback_result.GetCallbackObject(); | 2432 Object* obj = callback_result.GetCallbackObject(); |
2433 if (obj->IsAccessorInfo() && | 2433 if (obj->IsAccessorInfo() && |
2434 AccessorInfo::cast(obj)->prohibits_overwriting()) { | 2434 AccessorInfo::cast(obj)->prohibits_overwriting()) { |
2435 return Heap::undefined_value(); | 2435 return Heap::undefined_value(); |
2436 } | 2436 } |
2437 } | 2437 } |
(...skipping 4577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7015 // No break point. | 7015 // No break point. |
7016 if (break_point_objects()->IsUndefined()) return 0; | 7016 if (break_point_objects()->IsUndefined()) return 0; |
7017 // Single beak point. | 7017 // Single beak point. |
7018 if (!break_point_objects()->IsFixedArray()) return 1; | 7018 if (!break_point_objects()->IsFixedArray()) return 1; |
7019 // Multiple break points. | 7019 // Multiple break points. |
7020 return FixedArray::cast(break_point_objects())->length(); | 7020 return FixedArray::cast(break_point_objects())->length(); |
7021 } | 7021 } |
7022 | 7022 |
7023 | 7023 |
7024 } } // namespace v8::internal | 7024 } } // namespace v8::internal |
OLD | NEW |