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 11453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11464 } | 11464 } |
11465 | 11465 |
11466 | 11466 |
11467 JSGlobalPropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) { | 11467 JSGlobalPropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) { |
11468 ASSERT(!HasFastProperties()); | 11468 ASSERT(!HasFastProperties()); |
11469 Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry()); | 11469 Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry()); |
11470 return JSGlobalPropertyCell::cast(value); | 11470 return JSGlobalPropertyCell::cast(value); |
11471 } | 11471 } |
11472 | 11472 |
11473 | 11473 |
| 11474 Handle<JSGlobalPropertyCell> GlobalObject::EnsurePropertyCell( |
| 11475 Handle<GlobalObject> global, |
| 11476 Handle<String> name) { |
| 11477 Isolate* isolate = global->GetIsolate(); |
| 11478 CALL_HEAP_FUNCTION(isolate, |
| 11479 global->EnsurePropertyCell(*name), |
| 11480 JSGlobalPropertyCell); |
| 11481 } |
| 11482 |
| 11483 |
11474 MaybeObject* GlobalObject::EnsurePropertyCell(String* name) { | 11484 MaybeObject* GlobalObject::EnsurePropertyCell(String* name) { |
11475 ASSERT(!HasFastProperties()); | 11485 ASSERT(!HasFastProperties()); |
11476 int entry = property_dictionary()->FindEntry(name); | 11486 int entry = property_dictionary()->FindEntry(name); |
11477 if (entry == StringDictionary::kNotFound) { | 11487 if (entry == StringDictionary::kNotFound) { |
11478 Heap* heap = GetHeap(); | 11488 Heap* heap = GetHeap(); |
11479 Object* cell; | 11489 Object* cell; |
11480 { MaybeObject* maybe_cell = | 11490 { MaybeObject* maybe_cell = |
11481 heap->AllocateJSGlobalPropertyCell(heap->the_hole_value()); | 11491 heap->AllocateJSGlobalPropertyCell(heap->the_hole_value()); |
11482 if (!maybe_cell->ToObject(&cell)) return maybe_cell; | 11492 if (!maybe_cell->ToObject(&cell)) return maybe_cell; |
11483 } | 11493 } |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12631 if (break_point_objects()->IsUndefined()) return 0; | 12641 if (break_point_objects()->IsUndefined()) return 0; |
12632 // Single break point. | 12642 // Single break point. |
12633 if (!break_point_objects()->IsFixedArray()) return 1; | 12643 if (!break_point_objects()->IsFixedArray()) return 1; |
12634 // Multiple break points. | 12644 // Multiple break points. |
12635 return FixedArray::cast(break_point_objects())->length(); | 12645 return FixedArray::cast(break_point_objects())->length(); |
12636 } | 12646 } |
12637 #endif // ENABLE_DEBUGGER_SUPPORT | 12647 #endif // ENABLE_DEBUGGER_SUPPORT |
12638 | 12648 |
12639 | 12649 |
12640 } } // namespace v8::internal | 12650 } } // namespace v8::internal |
OLD | NEW |