OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/code-stub-assembler.h" | 4 #include "src/code-stub-assembler.h" |
5 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/frames-inl.h" | 6 #include "src/frames-inl.h" |
7 #include "src/frames.h" | 7 #include "src/frames.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 Node* start_address = IntPtrAdd( | 1887 Node* start_address = IntPtrAdd( |
1888 result_word, IntPtrConstant(NameDictionary::OffsetOfElementAt( | 1888 result_word, IntPtrConstant(NameDictionary::OffsetOfElementAt( |
1889 NameDictionary::kElementsStartIndex) - | 1889 NameDictionary::kElementsStartIndex) - |
1890 kHeapObjectTag)); | 1890 kHeapObjectTag)); |
1891 Node* end_address = IntPtrAdd( | 1891 Node* end_address = IntPtrAdd( |
1892 result_word, IntPtrSub(store_size, IntPtrConstant(kHeapObjectTag))); | 1892 result_word, IntPtrSub(store_size, IntPtrConstant(kHeapObjectTag))); |
1893 StoreFieldsNoWriteBarrier(start_address, end_address, filler); | 1893 StoreFieldsNoWriteBarrier(start_address, end_address, filler); |
1894 return result; | 1894 return result; |
1895 } | 1895 } |
1896 | 1896 |
| 1897 Node* CodeStubAssembler::CopyNameDictionary(Node* dictionary, |
| 1898 Label* large_object_fallback) { |
| 1899 Comment("Copy boilerplate property dict"); |
| 1900 Label copy_larg_object(this), done(this); |
| 1901 Node* length = SmiUntag(LoadFixedArrayBaseLength(dictionary)); |
| 1902 GotoIf( |
| 1903 IntPtrGreaterThan(length, IntPtrConstant(FixedArray::kMaxRegularLength)), |
| 1904 large_object_fallback); |
| 1905 Node* properties = |
| 1906 AllocateNameDictionary(SmiUntag(GetCapacity<NameDictionary>(dictionary))); |
| 1907 CopyFixedArrayElements(FAST_ELEMENTS, dictionary, properties, length, |
| 1908 SKIP_WRITE_BARRIER, INTPTR_PARAMETERS); |
| 1909 return properties; |
| 1910 } |
| 1911 |
1897 Node* CodeStubAssembler::AllocateJSObjectFromMap(Node* map, Node* properties, | 1912 Node* CodeStubAssembler::AllocateJSObjectFromMap(Node* map, Node* properties, |
1898 Node* elements, | 1913 Node* elements, |
1899 AllocationFlags flags) { | 1914 AllocationFlags flags) { |
1900 CSA_ASSERT(this, IsMap(map)); | 1915 CSA_ASSERT(this, IsMap(map)); |
1901 Node* size = | 1916 Node* size = |
1902 IntPtrMul(LoadMapInstanceSize(map), IntPtrConstant(kPointerSize)); | 1917 IntPtrMul(LoadMapInstanceSize(map), IntPtrConstant(kPointerSize)); |
1903 Node* object = AllocateInNewSpace(size, flags); | 1918 Node* object = AllocateInNewSpace(size, flags); |
1904 StoreMapNoWriteBarrier(object, map); | 1919 StoreMapNoWriteBarrier(object, map); |
1905 InitializeJSObjectFromMap(object, map, size, properties, elements); | 1920 InitializeJSObjectFromMap(object, map, size, properties, elements); |
1906 return object; | 1921 return object; |
(...skipping 2478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4385 Node* CodeStubAssembler::GetNumberOfDeletedElements(Node* dictionary) { | 4400 Node* CodeStubAssembler::GetNumberOfDeletedElements(Node* dictionary) { |
4386 return LoadFixedArrayElement(dictionary, | 4401 return LoadFixedArrayElement(dictionary, |
4387 Dictionary::kNumberOfDeletedElementsIndex); | 4402 Dictionary::kNumberOfDeletedElementsIndex); |
4388 } | 4403 } |
4389 | 4404 |
4390 template <class Dictionary> | 4405 template <class Dictionary> |
4391 Node* CodeStubAssembler::GetCapacity(Node* dictionary) { | 4406 Node* CodeStubAssembler::GetCapacity(Node* dictionary) { |
4392 return LoadFixedArrayElement(dictionary, Dictionary::kCapacityIndex); | 4407 return LoadFixedArrayElement(dictionary, Dictionary::kCapacityIndex); |
4393 } | 4408 } |
4394 | 4409 |
| 4410 template Node* CodeStubAssembler::GetCapacity<NameDictionary>(Node* dictionary); |
| 4411 |
4395 template <class Dictionary> | 4412 template <class Dictionary> |
4396 Node* CodeStubAssembler::GetNextEnumerationIndex(Node* dictionary) { | 4413 Node* CodeStubAssembler::GetNextEnumerationIndex(Node* dictionary) { |
4397 return LoadFixedArrayElement(dictionary, | 4414 return LoadFixedArrayElement(dictionary, |
4398 Dictionary::kNextEnumerationIndexIndex); | 4415 Dictionary::kNextEnumerationIndexIndex); |
4399 } | 4416 } |
4400 | 4417 |
4401 template <class Dictionary> | 4418 template <class Dictionary> |
4402 void CodeStubAssembler::SetNextEnumerationIndex(Node* dictionary, | 4419 void CodeStubAssembler::SetNextEnumerationIndex(Node* dictionary, |
4403 Node* next_enum_index_smi) { | 4420 Node* next_enum_index_smi) { |
4404 StoreFixedArrayElement(dictionary, Dictionary::kNextEnumerationIndexIndex, | 4421 StoreFixedArrayElement(dictionary, Dictionary::kNextEnumerationIndexIndex, |
(...skipping 3872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8277 formatted.c_str(), TENURED); | 8294 formatted.c_str(), TENURED); |
8278 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8295 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
8279 HeapConstant(string)); | 8296 HeapConstant(string)); |
8280 } | 8297 } |
8281 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 8298 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
8282 #endif | 8299 #endif |
8283 } | 8300 } |
8284 | 8301 |
8285 } // namespace internal | 8302 } // namespace internal |
8286 } // namespace v8 | 8303 } // namespace v8 |
OLD | NEW |