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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 | 63 |
64 static bool InsertionPointFound(String* key1, String* key2) { | 64 static bool InsertionPointFound(String* key1, String* key2) { |
65 return key1->Hash() > key2->Hash(); | 65 return key1->Hash() > key2->Hash(); |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 MaybeObject* TransitionArray::NewWith(String* name, Map* target) { | 69 MaybeObject* TransitionArray::NewWith(String* name, Map* target) { |
70 TransitionArray* result; | 70 TransitionArray* result; |
71 | 71 |
72 { MaybeObject* maybe_array; | 72 MaybeObject* maybe_array = TransitionArray::Allocate(1); |
73 maybe_array = TransitionArray::Allocate(1); | 73 if (!maybe_array->To(&result)) return maybe_array; |
74 if (!maybe_array->To(&result)) return maybe_array; | |
75 } | |
76 | 74 |
77 FixedArray::WhitenessWitness witness(result); | 75 FixedArray::WhitenessWitness witness(result); |
78 | 76 |
79 result->Set(0, name, target, witness); | 77 result->Set(0, name, target, witness); |
80 return result; | 78 return result; |
81 } | 79 } |
82 | 80 |
83 | 81 |
84 MaybeObject* TransitionArray::CopyInsert(String* name, Map* target) { | 82 MaybeObject* TransitionArray::CopyInsert(String* name, Map* target) { |
85 TransitionArray* result; | 83 TransitionArray* result; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 120 |
123 for (; insertion_index < number_of_transitions; ++insertion_index) { | 121 for (; insertion_index < number_of_transitions; ++insertion_index) { |
124 result->CopyFrom(this, insertion_index, insertion_index + 1, witness); | 122 result->CopyFrom(this, insertion_index, insertion_index + 1, witness); |
125 } | 123 } |
126 | 124 |
127 return result; | 125 return result; |
128 } | 126 } |
129 | 127 |
130 | 128 |
131 } } // namespace v8::internal | 129 } } // namespace v8::internal |
OLD | NEW |