OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3772 // hidden symbols hash code is zero (and no other string has hash | 3772 // hidden symbols hash code is zero (and no other string has hash |
3773 // code zero) it will always occupy the first entry if present. | 3773 // code zero) it will always occupy the first entry if present. |
3774 DescriptorArray* descriptors = this->map()->instance_descriptors(); | 3774 DescriptorArray* descriptors = this->map()->instance_descriptors(); |
3775 if ((descriptors->number_of_descriptors() > 0) && | 3775 if ((descriptors->number_of_descriptors() > 0) && |
3776 (descriptors->GetKey(0) == GetHeap()->hidden_symbol())) { | 3776 (descriptors->GetKey(0) == GetHeap()->hidden_symbol())) { |
3777 if (descriptors->GetType(0) == FIELD) { | 3777 if (descriptors->GetType(0) == FIELD) { |
3778 Object* hidden_store = | 3778 Object* hidden_store = |
3779 this->FastPropertyAt(descriptors->GetFieldIndex(0)); | 3779 this->FastPropertyAt(descriptors->GetFieldIndex(0)); |
3780 return StringDictionary::cast(hidden_store); | 3780 return StringDictionary::cast(hidden_store); |
3781 } else { | 3781 } else { |
3782 ASSERT(descriptors->GetType(0) == MAP_TRANSITION); | 3782 ASSERT(descriptors->GetType(0) == NULL_DESCRIPTOR || |
| 3783 descriptors->GetType(0) == MAP_TRANSITION); |
3783 } | 3784 } |
3784 } | 3785 } |
3785 } else { | 3786 } else { |
3786 PropertyAttributes attributes; | 3787 PropertyAttributes attributes; |
3787 // You can't install a getter on a property indexed by the hidden symbol, | 3788 // You can't install a getter on a property indexed by the hidden symbol, |
3788 // so we can be sure that GetLocalPropertyPostInterceptor returns a real | 3789 // so we can be sure that GetLocalPropertyPostInterceptor returns a real |
3789 // object. | 3790 // object. |
3790 Object* lookup = | 3791 Object* lookup = |
3791 GetLocalPropertyPostInterceptor(this, | 3792 GetLocalPropertyPostInterceptor(this, |
3792 GetHeap()->hidden_symbol(), | 3793 GetHeap()->hidden_symbol(), |
(...skipping 26 matching lines...) Expand all Loading... |
3819 // in the descriptor array matches the hidden symbol. Since the | 3820 // in the descriptor array matches the hidden symbol. Since the |
3820 // hidden symbols hash code is zero (and no other string has hash | 3821 // hidden symbols hash code is zero (and no other string has hash |
3821 // code zero) it will always occupy the first entry if present. | 3822 // code zero) it will always occupy the first entry if present. |
3822 DescriptorArray* descriptors = this->map()->instance_descriptors(); | 3823 DescriptorArray* descriptors = this->map()->instance_descriptors(); |
3823 if ((descriptors->number_of_descriptors() > 0) && | 3824 if ((descriptors->number_of_descriptors() > 0) && |
3824 (descriptors->GetKey(0) == GetHeap()->hidden_symbol())) { | 3825 (descriptors->GetKey(0) == GetHeap()->hidden_symbol())) { |
3825 if (descriptors->GetType(0) == FIELD) { | 3826 if (descriptors->GetType(0) == FIELD) { |
3826 this->FastPropertyAtPut(descriptors->GetFieldIndex(0), dictionary); | 3827 this->FastPropertyAtPut(descriptors->GetFieldIndex(0), dictionary); |
3827 return this; | 3828 return this; |
3828 } else { | 3829 } else { |
3829 ASSERT(descriptors->GetType(0) == MAP_TRANSITION); | 3830 ASSERT(descriptors->GetType(0) == NULL_DESCRIPTOR || |
| 3831 descriptors->GetType(0) == MAP_TRANSITION); |
3830 } | 3832 } |
3831 } | 3833 } |
3832 } | 3834 } |
3833 MaybeObject* store_result = | 3835 MaybeObject* store_result = |
3834 SetPropertyPostInterceptor(GetHeap()->hidden_symbol(), | 3836 SetPropertyPostInterceptor(GetHeap()->hidden_symbol(), |
3835 dictionary, | 3837 dictionary, |
3836 DONT_ENUM, | 3838 DONT_ENUM, |
3837 kNonStrictMode); | 3839 kNonStrictMode); |
3838 if (store_result->IsFailure()) return store_result; | 3840 if (store_result->IsFailure()) return store_result; |
3839 return this; | 3841 return this; |
(...skipping 9191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13031 if (break_point_objects()->IsUndefined()) return 0; | 13033 if (break_point_objects()->IsUndefined()) return 0; |
13032 // Single break point. | 13034 // Single break point. |
13033 if (!break_point_objects()->IsFixedArray()) return 1; | 13035 if (!break_point_objects()->IsFixedArray()) return 1; |
13034 // Multiple break points. | 13036 // Multiple break points. |
13035 return FixedArray::cast(break_point_objects())->length(); | 13037 return FixedArray::cast(break_point_objects())->length(); |
13036 } | 13038 } |
13037 #endif // ENABLE_DEBUGGER_SUPPORT | 13039 #endif // ENABLE_DEBUGGER_SUPPORT |
13038 | 13040 |
13039 | 13041 |
13040 } } // namespace v8::internal | 13042 } } // namespace v8::internal |
OLD | NEW |