| 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/compiler/js-native-context-specialization.h" | 5 #include "src/compiler/js-native-context-specialization.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
| 10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 Node* check = graph()->NewNode( | 203 Node* check = graph()->NewNode( |
| 204 simplified()->ReferenceEqual(Type::Tagged()), value, this_value); | 204 simplified()->ReferenceEqual(Type::Tagged()), value, this_value); |
| 205 Node* branch = graph()->NewNode(common()->Branch(BranchHint::kTrue), | 205 Node* branch = graph()->NewNode(common()->Branch(BranchHint::kTrue), |
| 206 check, this_control); | 206 check, this_control); |
| 207 exit_controls.push_back(graph()->NewNode(common()->IfFalse(), branch)); | 207 exit_controls.push_back(graph()->NewNode(common()->IfFalse(), branch)); |
| 208 this_control = graph()->NewNode(common()->IfTrue(), branch); | 208 this_control = graph()->NewNode(common()->IfTrue(), branch); |
| 209 } | 209 } |
| 210 } else { | 210 } else { |
| 211 DCHECK(access_info.IsDataField()); | 211 DCHECK(access_info.IsDataField()); |
| 212 FieldIndex const field_index = access_info.field_index(); | 212 FieldIndex const field_index = access_info.field_index(); |
| 213 FieldCheck const field_check = access_info.field_check(); |
| 213 Type* const field_type = access_info.field_type(); | 214 Type* const field_type = access_info.field_type(); |
| 215 switch (field_check) { |
| 216 case FieldCheck::kNone: |
| 217 break; |
| 218 case FieldCheck::kJSArrayBufferViewBufferNotNeutered: { |
| 219 Node* this_buffer = this_effect = |
| 220 graph()->NewNode(simplified()->LoadField( |
| 221 AccessBuilder::ForJSArrayBufferViewBuffer()), |
| 222 this_receiver, this_effect, this_control); |
| 223 Node* this_buffer_bit_field = this_effect = |
| 224 graph()->NewNode(simplified()->LoadField( |
| 225 AccessBuilder::ForJSArrayBufferBitField()), |
| 226 this_buffer, this_effect, this_control); |
| 227 Node* check = graph()->NewNode( |
| 228 machine()->Word32Equal(), |
| 229 graph()->NewNode(machine()->Word32And(), this_buffer_bit_field, |
| 230 jsgraph()->Int32Constant( |
| 231 1 << JSArrayBuffer::WasNeutered::kShift)), |
| 232 jsgraph()->Int32Constant(0)); |
| 233 Node* branch = graph()->NewNode(common()->Branch(BranchHint::kFalse), |
| 234 check, this_control); |
| 235 exit_controls.push_back(graph()->NewNode(common()->IfTrue(), branch)); |
| 236 this_control = graph()->NewNode(common()->IfFalse(), branch); |
| 237 break; |
| 238 } |
| 239 } |
| 214 if (access_mode == AccessMode::kLoad && | 240 if (access_mode == AccessMode::kLoad && |
| 215 access_info.holder().ToHandle(&holder)) { | 241 access_info.holder().ToHandle(&holder)) { |
| 216 this_receiver = jsgraph()->Constant(holder); | 242 this_receiver = jsgraph()->Constant(holder); |
| 217 } | 243 } |
| 218 Node* this_storage = this_receiver; | 244 Node* this_storage = this_receiver; |
| 219 if (!field_index.is_inobject()) { | 245 if (!field_index.is_inobject()) { |
| 220 this_storage = this_effect = graph()->NewNode( | 246 this_storage = this_effect = graph()->NewNode( |
| 221 simplified()->LoadField(AccessBuilder::ForJSObjectProperties()), | 247 simplified()->LoadField(AccessBuilder::ForJSObjectProperties()), |
| 222 this_storage, this_effect, this_control); | 248 this_storage, this_effect, this_control); |
| 223 } | 249 } |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 } | 1012 } |
| 987 | 1013 |
| 988 | 1014 |
| 989 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1015 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
| 990 return jsgraph()->simplified(); | 1016 return jsgraph()->simplified(); |
| 991 } | 1017 } |
| 992 | 1018 |
| 993 } // namespace compiler | 1019 } // namespace compiler |
| 994 } // namespace internal | 1020 } // namespace internal |
| 995 } // namespace v8 | 1021 } // namespace v8 |
| OLD | NEW |