| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/fast-accessor-assembler.h" | 5 #include "src/fast-accessor-assembler.h" |
| 6 | 6 |
| 7 #include "src/base/logging.h" | 7 #include "src/base/logging.h" |
| 8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
| 9 #include "src/code-stubs.h" // For CallApiCallbackStub. | 9 #include "src/code-stubs.h" // For CallApiCallbackStub. |
| 10 #include "src/handles-inl.h" | 10 #include "src/handles-inl.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 113 } |
| 114 | 114 |
| 115 void FastAccessorAssembler::CheckFlagSetOrReturnNull(ValueId value, int mask) { | 115 void FastAccessorAssembler::CheckFlagSetOrReturnNull(ValueId value, int mask) { |
| 116 CHECK_EQ(kBuilding, state_); | 116 CHECK_EQ(kBuilding, state_); |
| 117 CodeStubAssembler::Label pass(assembler_.get()); | 117 CodeStubAssembler::Label pass(assembler_.get()); |
| 118 CodeStubAssembler::Label fail(assembler_.get()); | 118 CodeStubAssembler::Label fail(assembler_.get()); |
| 119 assembler_->Branch( | 119 assembler_->Branch( |
| 120 assembler_->Word32Equal( | 120 assembler_->Word32Equal( |
| 121 assembler_->Word32And(FromId(value), assembler_->Int32Constant(mask)), | 121 assembler_->Word32And(FromId(value), assembler_->Int32Constant(mask)), |
| 122 assembler_->Int32Constant(0)), | 122 assembler_->Int32Constant(0)), |
| 123 &pass, &fail); | 123 &fail, &pass); |
| 124 assembler_->Bind(&fail); | 124 assembler_->Bind(&fail); |
| 125 assembler_->Return(assembler_->NullConstant()); | 125 assembler_->Return(assembler_->NullConstant()); |
| 126 assembler_->Bind(&pass); | 126 assembler_->Bind(&pass); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void FastAccessorAssembler::CheckNotZeroOrReturnNull(ValueId value) { | 129 void FastAccessorAssembler::CheckNotZeroOrReturnNull(ValueId value) { |
| 130 CHECK_EQ(kBuilding, state_); | 130 CHECK_EQ(kBuilding, state_); |
| 131 CodeStubAssembler::Label is_null(assembler_.get()); | 131 CodeStubAssembler::Label is_null(assembler_.get()); |
| 132 CodeStubAssembler::Label not_null(assembler_.get()); | 132 CodeStubAssembler::Label not_null(assembler_.get()); |
| 133 assembler_->Branch( | 133 assembler_->Branch( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 147 CHECK_EQ(kBuilding, state_); | 147 CHECK_EQ(kBuilding, state_); |
| 148 assembler_->Bind(FromId(label_id)); | 148 assembler_->Bind(FromId(label_id)); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void FastAccessorAssembler::CheckNotZeroOrJump(ValueId value_id, | 151 void FastAccessorAssembler::CheckNotZeroOrJump(ValueId value_id, |
| 152 LabelId label_id) { | 152 LabelId label_id) { |
| 153 CHECK_EQ(kBuilding, state_); | 153 CHECK_EQ(kBuilding, state_); |
| 154 CodeStubAssembler::Label pass(assembler_.get()); | 154 CodeStubAssembler::Label pass(assembler_.get()); |
| 155 assembler_->Branch( | 155 assembler_->Branch( |
| 156 assembler_->WordEqual(FromId(value_id), assembler_->IntPtrConstant(0)), | 156 assembler_->WordEqual(FromId(value_id), assembler_->IntPtrConstant(0)), |
| 157 &pass, FromId(label_id)); | 157 FromId(label_id), &pass); |
| 158 assembler_->Bind(&pass); | 158 assembler_->Bind(&pass); |
| 159 } | 159 } |
| 160 | 160 |
| 161 FastAccessorAssembler::ValueId FastAccessorAssembler::Call( | 161 FastAccessorAssembler::ValueId FastAccessorAssembler::Call( |
| 162 FunctionCallback callback_function, ValueId arg) { | 162 FunctionCallback callback_function, ValueId arg) { |
| 163 CHECK_EQ(kBuilding, state_); | 163 CHECK_EQ(kBuilding, state_); |
| 164 | 164 |
| 165 // Wrap the FunctionCallback in an ExternalReference. | 165 // Wrap the FunctionCallback in an ExternalReference. |
| 166 ApiFunction callback_api_function(FUNCTION_ADDR(callback_function)); | 166 ApiFunction callback_api_function(FUNCTION_ADDR(callback_function)); |
| 167 ExternalReference callback(&callback_api_function, | 167 ExternalReference callback(&callback_api_function, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 void FastAccessorAssembler::Clear() { | 229 void FastAccessorAssembler::Clear() { |
| 230 for (auto label : labels_) { | 230 for (auto label : labels_) { |
| 231 delete label; | 231 delete label; |
| 232 } | 232 } |
| 233 nodes_.clear(); | 233 nodes_.clear(); |
| 234 labels_.clear(); | 234 labels_.clear(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace internal | 237 } // namespace internal |
| 238 } // namespace v8 | 238 } // namespace v8 |
| OLD | NEW |