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 5523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5534 ? index_node | 5534 ? index_node |
5535 : ((element_size_shift > 0) | 5535 : ((element_size_shift > 0) |
5536 ? WordShl(index_node, IntPtrConstant(element_size_shift)) | 5536 ? WordShl(index_node, IntPtrConstant(element_size_shift)) |
5537 : WordShr(index_node, IntPtrConstant(-element_size_shift))); | 5537 : WordShr(index_node, IntPtrConstant(-element_size_shift))); |
5538 return IntPtrAdd(IntPtrConstant(base_size), shifted_index); | 5538 return IntPtrAdd(IntPtrConstant(base_size), shifted_index); |
5539 } | 5539 } |
5540 | 5540 |
5541 Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() { | 5541 Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() { |
5542 Node* function = | 5542 Node* function = |
5543 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); | 5543 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); |
5544 Node* literals = LoadObjectField(function, JSFunction::kLiteralsOffset); | 5544 return LoadObjectField(function, JSFunction::kFeedbackVectorOffset); |
5545 return LoadObjectField(literals, LiteralsArray::kFeedbackVectorOffset); | |
5546 } | 5545 } |
5547 | 5546 |
5548 void CodeStubAssembler::UpdateFeedback(Node* feedback, | 5547 void CodeStubAssembler::UpdateFeedback(Node* feedback, |
5549 Node* type_feedback_vector, | 5548 Node* type_feedback_vector, |
5550 Node* slot_id) { | 5549 Node* slot_id) { |
5551 // This method is used for binary op and compare feedback. These | 5550 // This method is used for binary op and compare feedback. These |
5552 // vector nodes are initialized with a smi 0, so we can simply OR | 5551 // vector nodes are initialized with a smi 0, so we can simply OR |
5553 // our new feedback in place. | 5552 // our new feedback in place. |
5554 Node* previous_feedback = | 5553 Node* previous_feedback = |
5555 LoadFixedArrayElement(type_feedback_vector, slot_id); | 5554 LoadFixedArrayElement(type_feedback_vector, slot_id); |
(...skipping 2778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8334 LoadObjectField(shared_info, SharedFunctionInfo::kCodeOffset)); | 8333 LoadObjectField(shared_info, SharedFunctionInfo::kCodeOffset)); |
8335 Node* const code_entry = | 8334 Node* const code_entry = |
8336 IntPtrAdd(code, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); | 8335 IntPtrAdd(code, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); |
8337 | 8336 |
8338 Node* const fun = Allocate(JSFunction::kSize); | 8337 Node* const fun = Allocate(JSFunction::kSize); |
8339 StoreMapNoWriteBarrier(fun, map); | 8338 StoreMapNoWriteBarrier(fun, map); |
8340 StoreObjectFieldRoot(fun, JSObject::kPropertiesOffset, | 8339 StoreObjectFieldRoot(fun, JSObject::kPropertiesOffset, |
8341 Heap::kEmptyFixedArrayRootIndex); | 8340 Heap::kEmptyFixedArrayRootIndex); |
8342 StoreObjectFieldRoot(fun, JSObject::kElementsOffset, | 8341 StoreObjectFieldRoot(fun, JSObject::kElementsOffset, |
8343 Heap::kEmptyFixedArrayRootIndex); | 8342 Heap::kEmptyFixedArrayRootIndex); |
8344 StoreObjectFieldRoot(fun, JSFunction::kLiteralsOffset, | 8343 StoreObjectFieldRoot(fun, JSFunction::kFeedbackVectorOffset, |
8345 Heap::kEmptyLiteralsArrayRootIndex); | 8344 Heap::kEmptyTypeFeedbackVectorRootIndex); |
8346 StoreObjectFieldRoot(fun, JSFunction::kPrototypeOrInitialMapOffset, | 8345 StoreObjectFieldRoot(fun, JSFunction::kPrototypeOrInitialMapOffset, |
8347 Heap::kTheHoleValueRootIndex); | 8346 Heap::kTheHoleValueRootIndex); |
8348 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kSharedFunctionInfoOffset, | 8347 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kSharedFunctionInfoOffset, |
8349 shared_info); | 8348 shared_info); |
8350 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kContextOffset, context); | 8349 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kContextOffset, context); |
8351 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kCodeEntryOffset, code_entry, | 8350 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kCodeEntryOffset, code_entry, |
8352 MachineType::PointerRepresentation()); | 8351 MachineType::PointerRepresentation()); |
8353 StoreObjectFieldRoot(fun, JSFunction::kNextFunctionLinkOffset, | 8352 StoreObjectFieldRoot(fun, JSFunction::kNextFunctionLinkOffset, |
8354 Heap::kUndefinedValueRootIndex); | 8353 Heap::kUndefinedValueRootIndex); |
8355 | 8354 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8397 formatted.c_str(), TENURED); | 8396 formatted.c_str(), TENURED); |
8398 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8397 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
8399 HeapConstant(string)); | 8398 HeapConstant(string)); |
8400 } | 8399 } |
8401 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 8400 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
8402 #endif | 8401 #endif |
8403 } | 8402 } |
8404 | 8403 |
8405 } // namespace internal | 8404 } // namespace internal |
8406 } // namespace v8 | 8405 } // namespace v8 |
OLD | NEW |