| 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 21 matching lines...) Expand all Loading... |
| 32 #include "factory.h" | 32 #include "factory.h" |
| 33 #include "scopeinfo.h" | 33 #include "scopeinfo.h" |
| 34 | 34 |
| 35 namespace v8 { | 35 namespace v8 { |
| 36 namespace internal { | 36 namespace internal { |
| 37 | 37 |
| 38 | 38 |
| 39 template <class C> | 39 template <class C> |
| 40 static C* FindInPrototypeChain(Object* obj, bool* found_it) { | 40 static C* FindInPrototypeChain(Object* obj, bool* found_it) { |
| 41 ASSERT(!*found_it); | 41 ASSERT(!*found_it); |
| 42 Heap* heap = HEAP; |
| 42 while (!Is<C>(obj)) { | 43 while (!Is<C>(obj)) { |
| 43 if (obj == HEAP->null_value()) return NULL; | 44 if (obj == heap->null_value()) return NULL; |
| 44 obj = obj->GetPrototype(); | 45 obj = obj->GetPrototype(); |
| 45 } | 46 } |
| 46 *found_it = true; | 47 *found_it = true; |
| 47 return C::cast(obj); | 48 return C::cast(obj); |
| 48 } | 49 } |
| 49 | 50 |
| 50 | 51 |
| 51 // Entry point that never should be called. | 52 // Entry point that never should be called. |
| 52 Object* Accessors::IllegalSetter(JSObject*, Object*, void*) { | 53 Object* Accessors::IllegalSetter(JSObject*, Object*, void*) { |
| 53 UNREACHABLE(); | 54 UNREACHABLE(); |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 } | 653 } |
| 653 | 654 |
| 654 | 655 |
| 655 const AccessorDescriptor Accessors::ObjectPrototype = { | 656 const AccessorDescriptor Accessors::ObjectPrototype = { |
| 656 ObjectGetPrototype, | 657 ObjectGetPrototype, |
| 657 ObjectSetPrototype, | 658 ObjectSetPrototype, |
| 658 0 | 659 0 |
| 659 }; | 660 }; |
| 660 | 661 |
| 661 } } // namespace v8::internal | 662 } } // namespace v8::internal |
| OLD | NEW |