| OLD | NEW |
| 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 if (!fun->shared()->IsApiFunction()) | 521 if (!fun->shared()->IsApiFunction()) |
| 522 return true; | 522 return true; |
| 523 // If the object is fully fast case and has the same map it was | 523 // If the object is fully fast case and has the same map it was |
| 524 // created with then no changes can have been made to it. | 524 // created with then no changes can have been made to it. |
| 525 return map() != fun->initial_map() | 525 return map() != fun->initial_map() |
| 526 || !HasFastElements() | 526 || !HasFastElements() |
| 527 || !HasFastProperties(); | 527 || !HasFastProperties(); |
| 528 } | 528 } |
| 529 | 529 |
| 530 | 530 |
| 531 Handle<Object> Object::GetProperty(Isolate* isolate, |
| 532 Handle<Object> object, |
| 533 Handle<Object> receiver, |
| 534 LookupResult* result, |
| 535 Handle<String> key, |
| 536 PropertyAttributes* attributes) { |
| 537 CALL_HEAP_FUNCTION( |
| 538 isolate, |
| 539 object->GetProperty(*receiver, result, *key, attributes), |
| 540 Object); |
| 541 } |
| 542 |
| 543 |
| 531 MaybeObject* Object::GetProperty(Object* receiver, | 544 MaybeObject* Object::GetProperty(Object* receiver, |
| 532 LookupResult* result, | 545 LookupResult* result, |
| 533 String* name, | 546 String* name, |
| 534 PropertyAttributes* attributes) { | 547 PropertyAttributes* attributes) { |
| 535 // Make sure that the top context does not change when doing | 548 // Make sure that the top context does not change when doing |
| 536 // callbacks or interceptor calls. | 549 // callbacks or interceptor calls. |
| 537 AssertNoContextChange ncc; | 550 AssertNoContextChange ncc; |
| 538 Heap* heap = name->GetHeap(); | 551 Heap* heap = name->GetHeap(); |
| 539 | 552 |
| 540 // Traverse the prototype chain from the current object (this) to | 553 // Traverse the prototype chain from the current object (this) to |
| (...skipping 2569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3110 | 3123 |
| 3111 | 3124 |
| 3112 void NormalizedMapCache::Clear() { | 3125 void NormalizedMapCache::Clear() { |
| 3113 int entries = length(); | 3126 int entries = length(); |
| 3114 for (int i = 0; i != entries; i++) { | 3127 for (int i = 0; i != entries; i++) { |
| 3115 set_undefined(i); | 3128 set_undefined(i); |
| 3116 } | 3129 } |
| 3117 } | 3130 } |
| 3118 | 3131 |
| 3119 | 3132 |
| 3133 void JSObject::UpdateMapCodeCache(Isolate* isolate, |
| 3134 Handle<JSObject> object, |
| 3135 Handle<String> name, |
| 3136 Handle<Code> code) { |
| 3137 CALL_HEAP_FUNCTION_VOID(isolate, |
| 3138 object->UpdateMapCodeCache(*name, *code)); |
| 3139 } |
| 3140 |
| 3141 |
| 3120 MaybeObject* JSObject::UpdateMapCodeCache(String* name, Code* code) { | 3142 MaybeObject* JSObject::UpdateMapCodeCache(String* name, Code* code) { |
| 3121 if (map()->is_shared()) { | 3143 if (map()->is_shared()) { |
| 3122 // Fast case maps are never marked as shared. | 3144 // Fast case maps are never marked as shared. |
| 3123 ASSERT(!HasFastProperties()); | 3145 ASSERT(!HasFastProperties()); |
| 3124 // Replace the map with an identical copy that can be safely modified. | 3146 // Replace the map with an identical copy that can be safely modified. |
| 3125 Object* obj; | 3147 Object* obj; |
| 3126 { MaybeObject* maybe_obj = map()->CopyNormalized(KEEP_INOBJECT_PROPERTIES, | 3148 { MaybeObject* maybe_obj = map()->CopyNormalized(KEEP_INOBJECT_PROPERTIES, |
| 3127 UNIQUE_NORMALIZED_MAP); | 3149 UNIQUE_NORMALIZED_MAP); |
| 3128 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 3150 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
| 3129 } | 3151 } |
| (...skipping 9173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12303 if (break_point_objects()->IsUndefined()) return 0; | 12325 if (break_point_objects()->IsUndefined()) return 0; |
| 12304 // Single break point. | 12326 // Single break point. |
| 12305 if (!break_point_objects()->IsFixedArray()) return 1; | 12327 if (!break_point_objects()->IsFixedArray()) return 1; |
| 12306 // Multiple break points. | 12328 // Multiple break points. |
| 12307 return FixedArray::cast(break_point_objects())->length(); | 12329 return FixedArray::cast(break_point_objects())->length(); |
| 12308 } | 12330 } |
| 12309 #endif // ENABLE_DEBUGGER_SUPPORT | 12331 #endif // ENABLE_DEBUGGER_SUPPORT |
| 12310 | 12332 |
| 12311 | 12333 |
| 12312 } } // namespace v8::internal | 12334 } } // namespace v8::internal |
| OLD | NEW |