Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/ic/stub-cache.h" | 8 #include "src/ic/stub-cache.h" |
| 9 #include "src/type-info.h" | 9 #include "src/type-info.h" |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 Handle<Context> native_context, | 110 Handle<Context> native_context, |
| 111 Zone* zone) { | 111 Zone* zone) { |
| 112 for (int i = 0; i < kPrimaryTableSize; i++) { | 112 for (int i = 0; i < kPrimaryTableSize; i++) { |
| 113 if (primary_[i].key == *name) { | 113 if (primary_[i].key == *name) { |
| 114 Map* map = primary_[i].map; | 114 Map* map = primary_[i].map; |
| 115 // Map can be NULL, if the stub is constant function call | 115 // Map can be NULL, if the stub is constant function call |
| 116 // with a primitive receiver. | 116 // with a primitive receiver. |
| 117 if (map == NULL) continue; | 117 if (map == NULL) continue; |
| 118 | 118 |
| 119 int offset = PrimaryOffset(*name, flags, map); | 119 int offset = PrimaryOffset(*name, flags, map); |
| 120 if (entry(primary_, offset) == &primary_[i] && | 120 if (entry(primary_, offset) == &primary_[i]) { |
|
Erik Corry
2015/03/26 10:09:43
Apart from avoiding leaks this also served to remo
Toon Verwaest
2015/03/26 10:19:06
That's true, but I presume we don't need the entir
| |
| 121 !TypeFeedbackOracle::CanRetainOtherContext(map, *native_context)) { | |
| 122 types->AddMapIfMissing(Handle<Map>(map), zone); | 121 types->AddMapIfMissing(Handle<Map>(map), zone); |
| 123 } | 122 } |
| 124 } | 123 } |
| 125 } | 124 } |
| 126 | 125 |
| 127 for (int i = 0; i < kSecondaryTableSize; i++) { | 126 for (int i = 0; i < kSecondaryTableSize; i++) { |
| 128 if (secondary_[i].key == *name) { | 127 if (secondary_[i].key == *name) { |
| 129 Map* map = secondary_[i].map; | 128 Map* map = secondary_[i].map; |
| 130 // Map can be NULL, if the stub is constant function call | 129 // Map can be NULL, if the stub is constant function call |
| 131 // with a primitive receiver. | 130 // with a primitive receiver. |
| 132 if (map == NULL) continue; | 131 if (map == NULL) continue; |
| 133 | 132 |
| 134 // Lookup in primary table and skip duplicates. | 133 // Lookup in primary table and skip duplicates. |
| 135 int primary_offset = PrimaryOffset(*name, flags, map); | 134 int primary_offset = PrimaryOffset(*name, flags, map); |
| 136 | 135 |
| 137 // Lookup in secondary table and add matches. | 136 // Lookup in secondary table and add matches. |
| 138 int offset = SecondaryOffset(*name, flags, primary_offset); | 137 int offset = SecondaryOffset(*name, flags, primary_offset); |
| 139 if (entry(secondary_, offset) == &secondary_[i] && | 138 if (entry(secondary_, offset) == &secondary_[i]) { |
| 140 !TypeFeedbackOracle::CanRetainOtherContext(map, *native_context)) { | |
| 141 types->AddMapIfMissing(Handle<Map>(map), zone); | 139 types->AddMapIfMissing(Handle<Map>(map), zone); |
| 142 } | 140 } |
| 143 } | 141 } |
| 144 } | 142 } |
| 145 } | 143 } |
| 146 } | 144 } |
| 147 } // namespace v8::internal | 145 } // namespace v8::internal |
| OLD | NEW |