OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 cache_array = handle(descriptors->GetEnumCache(), isolate); | 168 cache_array = handle(descriptors->GetEnumCache(), isolate); |
169 cache_length = cache_array->length(); | 169 cache_length = cache_array->length(); |
170 } else { | 170 } else { |
171 cache_array = isolate->factory()->empty_fixed_array(); | 171 cache_array = isolate->factory()->empty_fixed_array(); |
172 cache_length = 0; | 172 cache_length = 0; |
173 } | 173 } |
174 } else { | 174 } else { |
175 cache_array = Handle<FixedArray>::cast(cache_type); | 175 cache_array = Handle<FixedArray>::cast(cache_type); |
176 cache_length = cache_array->length(); | 176 cache_length = cache_array->length(); |
177 | 177 |
178 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 178 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); |
179 if (receiver_map->instance_type() <= LAST_JS_PROXY_TYPE) { | 179 if (receiver_map->instance_type() <= LAST_JS_PROXY_TYPE) { |
180 DCHECK_GE(receiver_map->instance_type(), LAST_JS_PROXY_TYPE); | 180 DCHECK_GE(receiver_map->instance_type(), LAST_JS_PROXY_TYPE); |
181 // Zero indicates proxy | 181 // Zero indicates proxy |
182 cache_type = Handle<Object>(Smi::FromInt(0), isolate); | 182 cache_type = Handle<Object>(Smi::FromInt(0), isolate); |
183 } else { | 183 } else { |
184 // One entails slow check | 184 // One entails slow check |
185 cache_type = Handle<Object>(Smi::FromInt(1), isolate); | 185 cache_type = Handle<Object>(Smi::FromInt(1), isolate); |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 Handle<FixedArray> result = isolate->factory()->NewFixedArray(4); | 189 Handle<FixedArray> result = isolate->factory()->NewFixedArray(4); |
190 result->set(0, *receiver); | 190 result->set(0, *receiver); |
191 result->set(1, *cache_array); | 191 result->set(1, *cache_array); |
192 result->set(2, *cache_type); | 192 result->set(2, *cache_type); |
193 result->set(3, Smi::FromInt(cache_length)); | 193 result->set(3, Smi::FromInt(cache_length)); |
194 return *result; | 194 return *result; |
195 } | 195 } |
196 | 196 |
197 | 197 |
198 } // namespace internal | 198 } // namespace internal |
199 } // namespace v8 | 199 } // namespace v8 |
OLD | NEW |