OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 5143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5154 // code zero) it will always occupy the first entry if present. | 5154 // code zero) it will always occupy the first entry if present. |
5155 DescriptorArray* descriptors = this->map()->instance_descriptors(); | 5155 DescriptorArray* descriptors = this->map()->instance_descriptors(); |
5156 DescriptorReader r(descriptors); | 5156 DescriptorReader r(descriptors); |
5157 if (!r.eos() && (r.GetKey() == key) && r.IsProperty()) { | 5157 if (!r.eos() && (r.GetKey() == key) && r.IsProperty()) { |
5158 ASSERT(r.type() == FIELD); | 5158 ASSERT(r.type() == FIELD); |
5159 return FastPropertyAt(r.GetFieldIndex()); | 5159 return FastPropertyAt(r.GetFieldIndex()); |
5160 } | 5160 } |
5161 } | 5161 } |
5162 | 5162 |
5163 // Only attempt to find the hidden properties in the local object and not | 5163 // Only attempt to find the hidden properties in the local object and not |
5164 // in the prototype chain. | 5164 // in the prototype chain. Note that HasLocalProperty() can cause a GC in |
| 5165 // the general case, but in this case we know it won't hit an interceptor. |
5165 if (!this->HasLocalProperty(key)) { | 5166 if (!this->HasLocalProperty(key)) { |
5166 // Hidden properties object not found. Allocate a new hidden properties | 5167 // Hidden properties object not found. Allocate a new hidden properties |
5167 // object if requested. Otherwise return the undefined value. | 5168 // object if requested. Otherwise return the undefined value. |
5168 if (create_if_needed) { | 5169 if (create_if_needed) { |
5169 Object* obj = Heap::AllocateJSObject( | 5170 Object* obj = Heap::AllocateJSObject( |
5170 Top::context()->global_context()->object_function()); | 5171 Top::context()->global_context()->object_function()); |
5171 if (obj->IsFailure()) { | 5172 if (obj->IsFailure()) { |
5172 return obj; | 5173 return obj; |
5173 } | 5174 } |
5174 return this->SetProperty(key, obj, DONT_ENUM); | 5175 return this->SetProperty(key, obj, DONT_ENUM); |
(...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7500 // No break point. | 7501 // No break point. |
7501 if (break_point_objects()->IsUndefined()) return 0; | 7502 if (break_point_objects()->IsUndefined()) return 0; |
7502 // Single beak point. | 7503 // Single beak point. |
7503 if (!break_point_objects()->IsFixedArray()) return 1; | 7504 if (!break_point_objects()->IsFixedArray()) return 1; |
7504 // Multiple break points. | 7505 // Multiple break points. |
7505 return FixedArray::cast(break_point_objects())->length(); | 7506 return FixedArray::cast(break_point_objects())->length(); |
7506 } | 7507 } |
7507 #endif | 7508 #endif |
7508 | 7509 |
7509 } } // namespace v8::internal | 7510 } } // namespace v8::internal |
OLD | NEW |