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 5465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5476 ? index_node | 5476 ? index_node |
5477 : ((element_size_shift > 0) | 5477 : ((element_size_shift > 0) |
5478 ? WordShl(index_node, IntPtrConstant(element_size_shift)) | 5478 ? WordShl(index_node, IntPtrConstant(element_size_shift)) |
5479 : WordShr(index_node, IntPtrConstant(-element_size_shift))); | 5479 : WordShr(index_node, IntPtrConstant(-element_size_shift))); |
5480 return IntPtrAdd(IntPtrConstant(base_size), shifted_index); | 5480 return IntPtrAdd(IntPtrConstant(base_size), shifted_index); |
5481 } | 5481 } |
5482 | 5482 |
5483 Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() { | 5483 Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() { |
5484 Node* function = | 5484 Node* function = |
5485 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); | 5485 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); |
5486 return LoadObjectField(function, JSFunction::kFeedbackVectorOffset); | 5486 Node* cell = LoadObjectField(function, JSFunction::kFeedbackVectorOffset); |
| 5487 return LoadObjectField(cell, Cell::kValueOffset); |
5487 } | 5488 } |
5488 | 5489 |
5489 void CodeStubAssembler::UpdateFeedback(Node* feedback, | 5490 void CodeStubAssembler::UpdateFeedback(Node* feedback, |
5490 Node* type_feedback_vector, | 5491 Node* type_feedback_vector, |
5491 Node* slot_id) { | 5492 Node* slot_id) { |
5492 // This method is used for binary op and compare feedback. These | 5493 // This method is used for binary op and compare feedback. These |
5493 // vector nodes are initialized with a smi 0, so we can simply OR | 5494 // vector nodes are initialized with a smi 0, so we can simply OR |
5494 // our new feedback in place. | 5495 // our new feedback in place. |
5495 Node* previous_feedback = | 5496 Node* previous_feedback = |
5496 LoadFixedArrayElement(type_feedback_vector, slot_id); | 5497 LoadFixedArrayElement(type_feedback_vector, slot_id); |
(...skipping 2787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8284 Node* const code_entry = | 8285 Node* const code_entry = |
8285 IntPtrAdd(code, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); | 8286 IntPtrAdd(code, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); |
8286 | 8287 |
8287 Node* const fun = Allocate(JSFunction::kSize); | 8288 Node* const fun = Allocate(JSFunction::kSize); |
8288 StoreMapNoWriteBarrier(fun, map); | 8289 StoreMapNoWriteBarrier(fun, map); |
8289 StoreObjectFieldRoot(fun, JSObject::kPropertiesOffset, | 8290 StoreObjectFieldRoot(fun, JSObject::kPropertiesOffset, |
8290 Heap::kEmptyFixedArrayRootIndex); | 8291 Heap::kEmptyFixedArrayRootIndex); |
8291 StoreObjectFieldRoot(fun, JSObject::kElementsOffset, | 8292 StoreObjectFieldRoot(fun, JSObject::kElementsOffset, |
8292 Heap::kEmptyFixedArrayRootIndex); | 8293 Heap::kEmptyFixedArrayRootIndex); |
8293 StoreObjectFieldRoot(fun, JSFunction::kFeedbackVectorOffset, | 8294 StoreObjectFieldRoot(fun, JSFunction::kFeedbackVectorOffset, |
8294 Heap::kEmptyTypeFeedbackVectorRootIndex); | 8295 Heap::kUndefinedCellRootIndex); |
8295 StoreObjectFieldRoot(fun, JSFunction::kPrototypeOrInitialMapOffset, | 8296 StoreObjectFieldRoot(fun, JSFunction::kPrototypeOrInitialMapOffset, |
8296 Heap::kTheHoleValueRootIndex); | 8297 Heap::kTheHoleValueRootIndex); |
8297 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kSharedFunctionInfoOffset, | 8298 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kSharedFunctionInfoOffset, |
8298 shared_info); | 8299 shared_info); |
8299 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kContextOffset, context); | 8300 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kContextOffset, context); |
8300 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kCodeEntryOffset, code_entry, | 8301 StoreObjectFieldNoWriteBarrier(fun, JSFunction::kCodeEntryOffset, code_entry, |
8301 MachineType::PointerRepresentation()); | 8302 MachineType::PointerRepresentation()); |
8302 StoreObjectFieldRoot(fun, JSFunction::kNextFunctionLinkOffset, | 8303 StoreObjectFieldRoot(fun, JSFunction::kNextFunctionLinkOffset, |
8303 Heap::kUndefinedValueRootIndex); | 8304 Heap::kUndefinedValueRootIndex); |
8304 | 8305 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8346 formatted.c_str(), TENURED); | 8347 formatted.c_str(), TENURED); |
8347 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8348 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
8348 HeapConstant(string)); | 8349 HeapConstant(string)); |
8349 } | 8350 } |
8350 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 8351 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
8351 #endif | 8352 #endif |
8352 } | 8353 } |
8353 | 8354 |
8354 } // namespace internal | 8355 } // namespace internal |
8355 } // namespace v8 | 8356 } // namespace v8 |
OLD | NEW |