| 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 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 Node* start_address = IntPtrAdd( | 2040 Node* start_address = IntPtrAdd( |
| 2041 result_word, IntPtrConstant(NameDictionary::OffsetOfElementAt( | 2041 result_word, IntPtrConstant(NameDictionary::OffsetOfElementAt( |
| 2042 NameDictionary::kElementsStartIndex) - | 2042 NameDictionary::kElementsStartIndex) - |
| 2043 kHeapObjectTag)); | 2043 kHeapObjectTag)); |
| 2044 Node* end_address = IntPtrAdd( | 2044 Node* end_address = IntPtrAdd( |
| 2045 result_word, IntPtrSub(store_size, IntPtrConstant(kHeapObjectTag))); | 2045 result_word, IntPtrSub(store_size, IntPtrConstant(kHeapObjectTag))); |
| 2046 StoreFieldsNoWriteBarrier(start_address, end_address, filler); | 2046 StoreFieldsNoWriteBarrier(start_address, end_address, filler); |
| 2047 return result; | 2047 return result; |
| 2048 } | 2048 } |
| 2049 | 2049 |
| 2050 Node* CodeStubAssembler::CopyNameDictionary(Node* dictionary, |
| 2051 Label* large_object_fallback) { |
| 2052 Comment("Copy boilerplate property dict"); |
| 2053 Label done(this); |
| 2054 Node* length = SmiUntag(LoadFixedArrayBaseLength(dictionary)); |
| 2055 GotoIf( |
| 2056 IntPtrGreaterThan(length, IntPtrConstant(FixedArray::kMaxRegularLength)), |
| 2057 large_object_fallback); |
| 2058 Node* properties = |
| 2059 AllocateNameDictionary(SmiUntag(GetCapacity<NameDictionary>(dictionary))); |
| 2060 CopyFixedArrayElements(FAST_ELEMENTS, dictionary, properties, length, |
| 2061 SKIP_WRITE_BARRIER, INTPTR_PARAMETERS); |
| 2062 return properties; |
| 2063 } |
| 2064 |
| 2050 Node* CodeStubAssembler::AllocateJSObjectFromMap(Node* map, Node* properties, | 2065 Node* CodeStubAssembler::AllocateJSObjectFromMap(Node* map, Node* properties, |
| 2051 Node* elements, | 2066 Node* elements, |
| 2052 AllocationFlags flags) { | 2067 AllocationFlags flags) { |
| 2053 CSA_ASSERT(this, IsMap(map)); | 2068 CSA_ASSERT(this, IsMap(map)); |
| 2054 Node* size = | 2069 Node* size = |
| 2055 IntPtrMul(LoadMapInstanceSize(map), IntPtrConstant(kPointerSize)); | 2070 IntPtrMul(LoadMapInstanceSize(map), IntPtrConstant(kPointerSize)); |
| 2056 Node* object = AllocateInNewSpace(size, flags); | 2071 Node* object = AllocateInNewSpace(size, flags); |
| 2057 StoreMapNoWriteBarrier(object, map); | 2072 StoreMapNoWriteBarrier(object, map); |
| 2058 InitializeJSObjectFromMap(object, map, size, properties, elements); | 2073 InitializeJSObjectFromMap(object, map, size, properties, elements); |
| 2059 return object; | 2074 return object; |
| (...skipping 6596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8656 formatted.c_str(), TENURED); | 8671 formatted.c_str(), TENURED); |
| 8657 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8672 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
| 8658 HeapConstant(string)); | 8673 HeapConstant(string)); |
| 8659 } | 8674 } |
| 8660 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 8675 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
| 8661 #endif | 8676 #endif |
| 8662 } | 8677 } |
| 8663 | 8678 |
| 8664 } // namespace internal | 8679 } // namespace internal |
| 8665 } // namespace v8 | 8680 } // namespace v8 |
| OLD | NEW |