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 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1625 Handle<JSFunction> fun(JSFunction::cast(setter)); | 1625 Handle<JSFunction> fun(JSFunction::cast(setter)); |
1626 Handle<JSObject> self(this); | 1626 Handle<JSObject> self(this); |
1627 bool has_pending_exception; | 1627 bool has_pending_exception; |
1628 Object** argv[] = { value_handle.location() }; | 1628 Object** argv[] = { value_handle.location() }; |
1629 Execution::Call(fun, self, 1, argv, &has_pending_exception); | 1629 Execution::Call(fun, self, 1, argv, &has_pending_exception); |
1630 // Check for pending exception and return the result. | 1630 // Check for pending exception and return the result. |
1631 if (has_pending_exception) return Failure::Exception(); | 1631 if (has_pending_exception) return Failure::Exception(); |
1632 return *value_handle; | 1632 return *value_handle; |
1633 } | 1633 } |
1634 | 1634 |
| 1635 |
1635 void JSObject::LookupCallbackSetterInPrototypes(String* name, | 1636 void JSObject::LookupCallbackSetterInPrototypes(String* name, |
1636 LookupResult* result) { | 1637 LookupResult* result) { |
1637 for (Object* pt = GetPrototype(); | 1638 for (Object* pt = GetPrototype(); |
1638 pt != Heap::null_value(); | 1639 pt != Heap::null_value(); |
1639 pt = pt->GetPrototype()) { | 1640 pt = pt->GetPrototype()) { |
1640 JSObject::cast(pt)->LocalLookupRealNamedProperty(name, result); | 1641 JSObject::cast(pt)->LocalLookupRealNamedProperty(name, result); |
1641 if (result->IsValid()) { | 1642 if (result->IsValid()) { |
1642 if (!result->IsTransitionType() && result->IsReadOnly()) { | 1643 if (!result->IsTransitionType() && result->IsReadOnly()) { |
1643 result->NotFound(); | 1644 result->NotFound(); |
1644 return; | 1645 return; |
1645 } | 1646 } |
1646 if (result->type() == CALLBACKS) { | 1647 if (result->type() == CALLBACKS) { |
1647 return; | 1648 return; |
1648 } | 1649 } |
1649 } | 1650 } |
1650 } | 1651 } |
1651 result->NotFound(); | 1652 result->NotFound(); |
1652 } | 1653 } |
1653 | 1654 |
1654 | 1655 |
1655 Object* JSObject::LookupCallbackSetterInPrototypes(uint32_t index) { | 1656 Object* JSObject::LookupCallbackSetterInPrototypes(uint32_t index) { |
1656 for (Object* pt = GetPrototype(); | 1657 for (Object* pt = GetPrototype(); |
1657 pt != Heap::null_value(); | 1658 pt != Heap::null_value(); |
1658 pt = pt->GetPrototype()) { | 1659 pt = pt->GetPrototype()) { |
1659 if (JSObject::cast(pt)->HasFastElements()) continue; | 1660 if (JSObject::cast(pt)->HasFastElements()) continue; |
1660 NumberDictionary* dictionary = JSObject::cast(pt)->element_dictionary(); | 1661 NumberDictionary* dictionary = JSObject::cast(pt)->element_dictionary(); |
1661 int entry = dictionary->FindEntry(index); | 1662 int entry = dictionary->FindEntry(index); |
1662 if (entry != StringDictionary::kNotFound) { | 1663 if (entry != NumberDictionary::kNotFound) { |
1663 Object* element = dictionary->ValueAt(entry); | 1664 Object* element = dictionary->ValueAt(entry); |
1664 PropertyDetails details = dictionary->DetailsAt(entry); | 1665 PropertyDetails details = dictionary->DetailsAt(entry); |
1665 if (details.type() == CALLBACKS) { | 1666 if (details.type() == CALLBACKS) { |
1666 // Only accessors allowed as elements. | 1667 // Only accessors allowed as elements. |
1667 return FixedArray::cast(element)->get(kSetterIndex); | 1668 return FixedArray::cast(element)->get(kSetterIndex); |
1668 } | 1669 } |
1669 } | 1670 } |
1670 } | 1671 } |
1671 return Heap::undefined_value(); | 1672 return Heap::undefined_value(); |
1672 } | 1673 } |
(...skipping 6061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7734 if (break_point_objects()->IsUndefined()) return 0; | 7735 if (break_point_objects()->IsUndefined()) return 0; |
7735 // Single beak point. | 7736 // Single beak point. |
7736 if (!break_point_objects()->IsFixedArray()) return 1; | 7737 if (!break_point_objects()->IsFixedArray()) return 1; |
7737 // Multiple break points. | 7738 // Multiple break points. |
7738 return FixedArray::cast(break_point_objects())->length(); | 7739 return FixedArray::cast(break_point_objects())->length(); |
7739 } | 7740 } |
7740 #endif | 7741 #endif |
7741 | 7742 |
7742 | 7743 |
7743 } } // namespace v8::internal | 7744 } } // namespace v8::internal |
OLD | NEW |