| 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 5514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5525 ? index_node | 5525 ? index_node |
| 5526 : ((element_size_shift > 0) | 5526 : ((element_size_shift > 0) |
| 5527 ? WordShl(index_node, IntPtrConstant(element_size_shift)) | 5527 ? WordShl(index_node, IntPtrConstant(element_size_shift)) |
| 5528 : WordShr(index_node, IntPtrConstant(-element_size_shift))); | 5528 : WordShr(index_node, IntPtrConstant(-element_size_shift))); |
| 5529 return IntPtrAdd(IntPtrConstant(base_size), shifted_index); | 5529 return IntPtrAdd(IntPtrConstant(base_size), shifted_index); |
| 5530 } | 5530 } |
| 5531 | 5531 |
| 5532 Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() { | 5532 Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() { |
| 5533 Node* function = | 5533 Node* function = |
| 5534 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); | 5534 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); |
| 5535 Node* literals = LoadObjectField(function, JSFunction::kLiteralsOffset); | 5535 return LoadObjectField(function, JSFunction::kFeedbackVectorOffset); |
| 5536 return LoadObjectField(literals, LiteralsArray::kFeedbackVectorOffset); | |
| 5537 } | 5536 } |
| 5538 | 5537 |
| 5539 void CodeStubAssembler::UpdateFeedback(Node* feedback, | 5538 void CodeStubAssembler::UpdateFeedback(Node* feedback, |
| 5540 Node* type_feedback_vector, | 5539 Node* type_feedback_vector, |
| 5541 Node* slot_id) { | 5540 Node* slot_id) { |
| 5542 // This method is used for binary op and compare feedback. These | 5541 // This method is used for binary op and compare feedback. These |
| 5543 // vector nodes are initialized with a smi 0, so we can simply OR | 5542 // vector nodes are initialized with a smi 0, so we can simply OR |
| 5544 // our new feedback in place. | 5543 // our new feedback in place. |
| 5545 Node* previous_feedback = | 5544 Node* previous_feedback = |
| 5546 LoadFixedArrayElement(type_feedback_vector, slot_id); | 5545 LoadFixedArrayElement(type_feedback_vector, slot_id); |
| (...skipping 2778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8325 LoadObjectField(shared_info, SharedFunctionInfo::kCodeOffset)); | 8324 LoadObjectField(shared_info, SharedFunctionInfo::kCodeOffset)); |
| 8326 Node* const code_entry = | 8325 Node* const code_entry = |
| 8327 IntPtrAdd(code, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); | 8326 IntPtrAdd(code, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); |
| 8328 | 8327 |
| 8329 Node* const fun = Allocate(JSFunction::kSize); | 8328 Node* const fun = Allocate(JSFunction::kSize); |
| 8330 StoreMapNoWriteBarrier(fun, map); | 8329 StoreMapNoWriteBarrier(fun, map); |
| 8331 StoreObjectFieldRoot(fun, JSObject::kPropertiesOffset, | 8330 StoreObjectFieldRoot(fun, JSObject::kPropertiesOffset, |
| 8332 Heap::kEmptyFixedArrayRootIndex); | 8331 Heap::kEmptyFixedArrayRootIndex); |
| 8333 StoreObjectFieldRoot(fun, JSObject::kElementsOffset, | 8332 StoreObjectFieldRoot(fun, JSObject::kElementsOffset, |
| 8334 Heap::kEmptyFixedArrayRootIndex); | 8333 Heap::kEmptyFixedArrayRootIndex); |
| 8335 StoreObjectFieldRoot(fun, JSFunction::kLiteralsOffset, | 8334 StoreObjectFieldRoot(fun, JSFunction::kFeedbackVectorOffset, |
| 8336 Heap::kEmptyLiteralsArrayRootIndex); | 8335 Heap::kEmptyTypeFeedbackVectorRootIndex); |
| 8337 StoreObjectFieldRoot(fun, JSFunction::kPrototypeOrInitialMapOffset, | 8336 StoreObjectFieldRoot(fun, JSFunction::kPrototypeOrInitialMapOffset, |
| 8338 Heap::kTheHoleValueRootIndex); | 8337 Heap::kTheHoleValueRootIndex); |
| 8339 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kSharedFunctionInfoOffset, | 8338 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kSharedFunctionInfoOffset, |
| 8340 shared_info); | 8339 shared_info); |
| 8341 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kContextOffset, context); | 8340 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kContextOffset, context); |
| 8342 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kCodeEntryOffset, code_entry, | 8341 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kCodeEntryOffset, code_entry, |
| 8343 MachineType::PointerRepresentation()); | 8342 MachineType::PointerRepresentation()); |
| 8344 StoreObjectFieldRoot(fun, JSFunction::kNextFunctionLinkOffset, | 8343 StoreObjectFieldRoot(fun, JSFunction::kNextFunctionLinkOffset, |
| 8345 Heap::kUndefinedValueRootIndex); | 8344 Heap::kUndefinedValueRootIndex); |
| 8346 | 8345 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8388 formatted.c_str(), TENURED); | 8387 formatted.c_str(), TENURED); |
| 8389 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8388 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
| 8390 HeapConstant(string)); | 8389 HeapConstant(string)); |
| 8391 } | 8390 } |
| 8392 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), tagged_value); | 8391 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), tagged_value); |
| 8393 #endif | 8392 #endif |
| 8394 } | 8393 } |
| 8395 | 8394 |
| 8396 } // namespace internal | 8395 } // namespace internal |
| 8397 } // namespace v8 | 8396 } // namespace v8 |
| OLD | NEW |