| 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/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 16159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16170 int capacity = (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY) | 16170 int capacity = (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY) |
| 16171 ? at_least_space_for | 16171 ? at_least_space_for |
| 16172 : ComputeCapacity(at_least_space_for); | 16172 : ComputeCapacity(at_least_space_for); |
| 16173 if (capacity > HashTable::kMaxCapacity) { | 16173 if (capacity > HashTable::kMaxCapacity) { |
| 16174 v8::internal::Heap::FatalProcessOutOfMemory("invalid table size", true); | 16174 v8::internal::Heap::FatalProcessOutOfMemory("invalid table size", true); |
| 16175 } | 16175 } |
| 16176 | 16176 |
| 16177 Factory* factory = isolate->factory(); | 16177 Factory* factory = isolate->factory(); |
| 16178 int length = EntryToIndex(capacity); | 16178 int length = EntryToIndex(capacity); |
| 16179 Handle<FixedArray> array = factory->NewFixedArray(length, pretenure); | 16179 Handle<FixedArray> array = factory->NewFixedArray(length, pretenure); |
| 16180 array->set_map_no_write_barrier(*factory->hash_table_map()); | 16180 array->set_map_no_write_barrier(Shape::GetMap(isolate)); |
| 16181 Handle<Derived> table = Handle<Derived>::cast(array); | 16181 Handle<Derived> table = Handle<Derived>::cast(array); |
| 16182 | 16182 |
| 16183 table->SetNumberOfElements(0); | 16183 table->SetNumberOfElements(0); |
| 16184 table->SetNumberOfDeletedElements(0); | 16184 table->SetNumberOfDeletedElements(0); |
| 16185 table->SetCapacity(capacity); | 16185 table->SetCapacity(capacity); |
| 16186 return table; | 16186 return table; |
| 16187 } | 16187 } |
| 16188 | 16188 |
| 16189 | 16189 |
| 16190 // Find entry for key otherwise return kNotFound. | 16190 // Find entry for key otherwise return kNotFound. |
| (...skipping 2771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18962 | 18962 |
| 18963 Object* data_obj = | 18963 Object* data_obj = |
| 18964 constructor->shared()->get_api_func_data()->access_check_info(); | 18964 constructor->shared()->get_api_func_data()->access_check_info(); |
| 18965 if (data_obj->IsUndefined(isolate)) return nullptr; | 18965 if (data_obj->IsUndefined(isolate)) return nullptr; |
| 18966 | 18966 |
| 18967 return AccessCheckInfo::cast(data_obj); | 18967 return AccessCheckInfo::cast(data_obj); |
| 18968 } | 18968 } |
| 18969 | 18969 |
| 18970 } // namespace internal | 18970 } // namespace internal |
| 18971 } // namespace v8 | 18971 } // namespace v8 |
| OLD | NEW |