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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 void TransitionArray::NoIncrementalWriteBarrierCopyFrom(TransitionArray* origin, | 59 void TransitionArray::NoIncrementalWriteBarrierCopyFrom(TransitionArray* origin, |
60 int origin_transition, | 60 int origin_transition, |
61 int target_transition) { | 61 int target_transition) { |
62 NoIncrementalWriteBarrierSet(target_transition, | 62 NoIncrementalWriteBarrierSet(target_transition, |
63 origin->GetKey(origin_transition), | 63 origin->GetKey(origin_transition), |
64 origin->GetTarget(origin_transition)); | 64 origin->GetTarget(origin_transition)); |
65 } | 65 } |
66 | 66 |
67 | 67 |
68 static bool InsertionPointFound(String* key1, String* key2) { | 68 static bool InsertionPointFound(Name* key1, Name* key2) { |
69 return key1->Hash() > key2->Hash(); | 69 return key1->Hash() > key2->Hash(); |
70 } | 70 } |
71 | 71 |
72 | 72 |
73 MaybeObject* TransitionArray::NewWith(SimpleTransitionFlag flag, | 73 MaybeObject* TransitionArray::NewWith(SimpleTransitionFlag flag, |
74 String* key, | 74 Name* key, |
75 Map* target, | 75 Map* target, |
76 Object* back_pointer) { | 76 Object* back_pointer) { |
77 TransitionArray* result; | 77 TransitionArray* result; |
78 MaybeObject* maybe_result; | 78 MaybeObject* maybe_result; |
79 | 79 |
80 if (flag == SIMPLE_TRANSITION) { | 80 if (flag == SIMPLE_TRANSITION) { |
81 maybe_result = AllocateRaw(kSimpleTransitionSize); | 81 maybe_result = AllocateRaw(kSimpleTransitionSize); |
82 if (!maybe_result->To(&result)) return maybe_result; | 82 if (!maybe_result->To(&result)) return maybe_result; |
83 result->set(kSimpleTransitionTarget, target); | 83 result->set(kSimpleTransitionTarget, target); |
84 } else { | 84 } else { |
(...skipping 15 matching lines...) Expand all Loading... |
100 | 100 |
101 if (nof == 1) { | 101 if (nof == 1) { |
102 result->NoIncrementalWriteBarrierCopyFrom(this, kSimpleTransitionIndex, 0); | 102 result->NoIncrementalWriteBarrierCopyFrom(this, kSimpleTransitionIndex, 0); |
103 } | 103 } |
104 | 104 |
105 result->set_back_pointer_storage(back_pointer_storage()); | 105 result->set_back_pointer_storage(back_pointer_storage()); |
106 return result; | 106 return result; |
107 } | 107 } |
108 | 108 |
109 | 109 |
110 MaybeObject* TransitionArray::CopyInsert(String* name, Map* target) { | 110 MaybeObject* TransitionArray::CopyInsert(Name* name, Map* target) { |
111 TransitionArray* result; | 111 TransitionArray* result; |
112 | 112 |
113 int number_of_transitions = this->number_of_transitions(); | 113 int number_of_transitions = this->number_of_transitions(); |
114 int new_size = number_of_transitions; | 114 int new_size = number_of_transitions; |
115 | 115 |
116 int insertion_index = this->Search(name); | 116 int insertion_index = this->Search(name); |
117 if (insertion_index == kNotFound) ++new_size; | 117 if (insertion_index == kNotFound) ++new_size; |
118 | 118 |
119 MaybeObject* maybe_array; | 119 MaybeObject* maybe_array; |
120 maybe_array = TransitionArray::Allocate(new_size); | 120 maybe_array = TransitionArray::Allocate(new_size); |
(...skipping 30 matching lines...) Expand all Loading... |
151 result->NoIncrementalWriteBarrierCopyFrom( | 151 result->NoIncrementalWriteBarrierCopyFrom( |
152 this, insertion_index, insertion_index + 1); | 152 this, insertion_index, insertion_index + 1); |
153 } | 153 } |
154 | 154 |
155 result->set_back_pointer_storage(back_pointer_storage()); | 155 result->set_back_pointer_storage(back_pointer_storage()); |
156 return result; | 156 return result; |
157 } | 157 } |
158 | 158 |
159 | 159 |
160 } } // namespace v8::internal | 160 } } // namespace v8::internal |
OLD | NEW |