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 | 4 |
5 #include "src/code-stub-assembler.h" | 5 #include "src/code-stub-assembler.h" |
6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
7 #include "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
8 #include "src/frames.h" | 8 #include "src/frames.h" |
9 #include "src/ic/handler-configuration.h" | 9 #include "src/ic/handler-configuration.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 Variable var_result(this, MachineRepresentation::kTagged); | 1246 Variable var_result(this, MachineRepresentation::kTagged); |
1247 | 1247 |
1248 // Compute the SeqOneByteString size and check if it fits into new space. | 1248 // Compute the SeqOneByteString size and check if it fits into new space. |
1249 Label if_sizeissmall(this), if_notsizeissmall(this, Label::kDeferred), | 1249 Label if_sizeissmall(this), if_notsizeissmall(this, Label::kDeferred), |
1250 if_join(this); | 1250 if_join(this); |
1251 Node* size = WordAnd( | 1251 Node* size = WordAnd( |
1252 IntPtrAdd( | 1252 IntPtrAdd( |
1253 IntPtrAdd(length, IntPtrConstant(SeqOneByteString::kHeaderSize)), | 1253 IntPtrAdd(length, IntPtrConstant(SeqOneByteString::kHeaderSize)), |
1254 IntPtrConstant(kObjectAlignmentMask)), | 1254 IntPtrConstant(kObjectAlignmentMask)), |
1255 IntPtrConstant(~kObjectAlignmentMask)); | 1255 IntPtrConstant(~kObjectAlignmentMask)); |
1256 Branch(IntPtrLessThanOrEqual(size, | 1256 Branch(IntPtrLessThanOrEqual(size, IntPtrConstant(kMaxRegularHeapObjectSize)), |
1257 IntPtrConstant(Page::kMaxRegularHeapObjectSize)), | |
1258 &if_sizeissmall, &if_notsizeissmall); | 1257 &if_sizeissmall, &if_notsizeissmall); |
1259 | 1258 |
1260 Bind(&if_sizeissmall); | 1259 Bind(&if_sizeissmall); |
1261 { | 1260 { |
1262 // Just allocate the SeqOneByteString in new space. | 1261 // Just allocate the SeqOneByteString in new space. |
1263 Node* result = Allocate(size); | 1262 Node* result = Allocate(size); |
1264 StoreMapNoWriteBarrier(result, LoadRoot(Heap::kOneByteStringMapRootIndex)); | 1263 StoreMapNoWriteBarrier(result, LoadRoot(Heap::kOneByteStringMapRootIndex)); |
1265 StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kLengthOffset, | 1264 StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kLengthOffset, |
1266 SmiFromWord(length)); | 1265 SmiFromWord(length)); |
1267 StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldOffset, | 1266 StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldOffset, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 Variable var_result(this, MachineRepresentation::kTagged); | 1298 Variable var_result(this, MachineRepresentation::kTagged); |
1300 | 1299 |
1301 // Compute the SeqTwoByteString size and check if it fits into new space. | 1300 // Compute the SeqTwoByteString size and check if it fits into new space. |
1302 Label if_sizeissmall(this), if_notsizeissmall(this, Label::kDeferred), | 1301 Label if_sizeissmall(this), if_notsizeissmall(this, Label::kDeferred), |
1303 if_join(this); | 1302 if_join(this); |
1304 Node* size = WordAnd( | 1303 Node* size = WordAnd( |
1305 IntPtrAdd(IntPtrAdd(WordShl(length, 1), | 1304 IntPtrAdd(IntPtrAdd(WordShl(length, 1), |
1306 IntPtrConstant(SeqTwoByteString::kHeaderSize)), | 1305 IntPtrConstant(SeqTwoByteString::kHeaderSize)), |
1307 IntPtrConstant(kObjectAlignmentMask)), | 1306 IntPtrConstant(kObjectAlignmentMask)), |
1308 IntPtrConstant(~kObjectAlignmentMask)); | 1307 IntPtrConstant(~kObjectAlignmentMask)); |
1309 Branch(IntPtrLessThanOrEqual(size, | 1308 Branch(IntPtrLessThanOrEqual(size, IntPtrConstant(kMaxRegularHeapObjectSize)), |
1310 IntPtrConstant(Page::kMaxRegularHeapObjectSize)), | |
1311 &if_sizeissmall, &if_notsizeissmall); | 1309 &if_sizeissmall, &if_notsizeissmall); |
1312 | 1310 |
1313 Bind(&if_sizeissmall); | 1311 Bind(&if_sizeissmall); |
1314 { | 1312 { |
1315 // Just allocate the SeqTwoByteString in new space. | 1313 // Just allocate the SeqTwoByteString in new space. |
1316 Node* result = Allocate(size); | 1314 Node* result = Allocate(size); |
1317 StoreMapNoWriteBarrier(result, LoadRoot(Heap::kStringMapRootIndex)); | 1315 StoreMapNoWriteBarrier(result, LoadRoot(Heap::kStringMapRootIndex)); |
1318 StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kLengthOffset, | 1316 StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kLengthOffset, |
1319 SmiFromWord(length)); | 1317 SmiFromWord(length)); |
1320 StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldOffset, | 1318 StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldOffset, |
(...skipping 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4212 Heap::kTheHoleValueRootIndex); | 4210 Heap::kTheHoleValueRootIndex); |
4213 | 4211 |
4214 // Store the WeakCell in the feedback vector. | 4212 // Store the WeakCell in the feedback vector. |
4215 StoreFixedArrayElement(feedback_vector, slot, cell, UPDATE_WRITE_BARRIER, | 4213 StoreFixedArrayElement(feedback_vector, slot, cell, UPDATE_WRITE_BARRIER, |
4216 CodeStubAssembler::SMI_PARAMETERS); | 4214 CodeStubAssembler::SMI_PARAMETERS); |
4217 return cell; | 4215 return cell; |
4218 } | 4216 } |
4219 | 4217 |
4220 } // namespace internal | 4218 } // namespace internal |
4221 } // namespace v8 | 4219 } // namespace v8 |
OLD | NEW |