| 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 3976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3987 compiler::Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() { | 3987 compiler::Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() { |
| 3988 Node* function = | 3988 Node* function = |
| 3989 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); | 3989 LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); |
| 3990 Node* literals = LoadObjectField(function, JSFunction::kLiteralsOffset); | 3990 Node* literals = LoadObjectField(function, JSFunction::kLiteralsOffset); |
| 3991 return LoadObjectField(literals, LiteralsArray::kFeedbackVectorOffset); | 3991 return LoadObjectField(literals, LiteralsArray::kFeedbackVectorOffset); |
| 3992 } | 3992 } |
| 3993 | 3993 |
| 3994 void CodeStubAssembler::UpdateFeedback(compiler::Node* feedback, | 3994 void CodeStubAssembler::UpdateFeedback(compiler::Node* feedback, |
| 3995 compiler::Node* type_feedback_vector, | 3995 compiler::Node* type_feedback_vector, |
| 3996 compiler::Node* slot_id) { | 3996 compiler::Node* slot_id) { |
| 3997 Label combine_feedback(this), record_feedback(this), end(this); | |
| 3998 | |
| 3999 // This method is used for binary op and compare feedback. These | 3997 // This method is used for binary op and compare feedback. These |
| 4000 // vector nodes are initialized with a smi 0, so we can simply OR | 3998 // vector nodes are initialized with a smi 0, so we can simply OR |
| 4001 // our new feedback in place. | 3999 // our new feedback in place. |
| 4000 // TODO(interpreter): Consider passing the feedback as Smi already to avoid |
| 4001 // the tagging completely. |
| 4002 Node* previous_feedback = | 4002 Node* previous_feedback = |
| 4003 LoadFixedArrayElement(type_feedback_vector, slot_id); | 4003 LoadFixedArrayElement(type_feedback_vector, slot_id); |
| 4004 Node* untagged_previous_feedback = SmiUntag(previous_feedback); | 4004 Node* combined_feedback = SmiOr(previous_feedback, SmiFromWord32(feedback)); |
| 4005 Node* combined_feedback = Word32Or(untagged_previous_feedback, feedback); | 4005 StoreFixedArrayElement(type_feedback_vector, slot_id, combined_feedback, |
| 4006 StoreFixedArrayElement(type_feedback_vector, slot_id, | 4006 SKIP_WRITE_BARRIER); |
| 4007 SmiTag(combined_feedback), SKIP_WRITE_BARRIER); | |
| 4008 } | 4007 } |
| 4009 | 4008 |
| 4010 compiler::Node* CodeStubAssembler::LoadReceiverMap(compiler::Node* receiver) { | 4009 compiler::Node* CodeStubAssembler::LoadReceiverMap(compiler::Node* receiver) { |
| 4011 Variable var_receiver_map(this, MachineRepresentation::kTagged); | 4010 Variable var_receiver_map(this, MachineRepresentation::kTagged); |
| 4012 // TODO(ishell): defer blocks when it works. | 4011 // TODO(ishell): defer blocks when it works. |
| 4013 Label load_smi_map(this /*, Label::kDeferred*/), load_receiver_map(this), | 4012 Label load_smi_map(this /*, Label::kDeferred*/), load_receiver_map(this), |
| 4014 if_result(this); | 4013 if_result(this); |
| 4015 | 4014 |
| 4016 Branch(WordIsSmi(receiver), &load_smi_map, &load_receiver_map); | 4015 Branch(WordIsSmi(receiver), &load_smi_map, &load_receiver_map); |
| 4017 Bind(&load_smi_map); | 4016 Bind(&load_smi_map); |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5533 Heap::kTheHoleValueRootIndex); | 5532 Heap::kTheHoleValueRootIndex); |
| 5534 | 5533 |
| 5535 // Store the WeakCell in the feedback vector. | 5534 // Store the WeakCell in the feedback vector. |
| 5536 StoreFixedArrayElement(feedback_vector, slot, cell, UPDATE_WRITE_BARRIER, | 5535 StoreFixedArrayElement(feedback_vector, slot, cell, UPDATE_WRITE_BARRIER, |
| 5537 CodeStubAssembler::SMI_PARAMETERS); | 5536 CodeStubAssembler::SMI_PARAMETERS); |
| 5538 return cell; | 5537 return cell; |
| 5539 } | 5538 } |
| 5540 | 5539 |
| 5541 } // namespace internal | 5540 } // namespace internal |
| 5542 } // namespace v8 | 5541 } // namespace v8 |
| OLD | NEW |