| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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/interpreter/interpreter-intrinsics-generator.h" | 5 #include "src/interpreter/interpreter-intrinsics-generator.h" |
| 6 | 6 |
| 7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
| 8 #include "src/builtins/builtins.h" | 8 #include "src/builtins/builtins.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/frames.h" | 10 #include "src/frames.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 Node* IntrinsicsGenerator::IsJSProxy(Node* input, Node* arg_count, | 190 Node* IntrinsicsGenerator::IsJSProxy(Node* input, Node* arg_count, |
| 191 Node* context) { | 191 Node* context) { |
| 192 return IsInstanceType(input, JS_PROXY_TYPE); | 192 return IsInstanceType(input, JS_PROXY_TYPE); |
| 193 } | 193 } |
| 194 | 194 |
| 195 Node* IntrinsicsGenerator::IsTypedArray(Node* input, Node* arg_count, | 195 Node* IntrinsicsGenerator::IsTypedArray(Node* input, Node* arg_count, |
| 196 Node* context) { | 196 Node* context) { |
| 197 return IsInstanceType(input, JS_TYPED_ARRAY_TYPE); | 197 return IsInstanceType(input, JS_TYPED_ARRAY_TYPE); |
| 198 } | 198 } |
| 199 | 199 |
| 200 Node* IntrinsicsGenerator::IsJSMap(Node* input, Node* arg_count, | |
| 201 Node* context) { | |
| 202 return IsInstanceType(input, JS_MAP_TYPE); | |
| 203 } | |
| 204 | |
| 205 Node* IntrinsicsGenerator::IsJSMapIterator(Node* input, Node* arg_count, | |
| 206 Node* context) { | |
| 207 return IsInstanceType(input, JS_MAP_ITERATOR_TYPE); | |
| 208 } | |
| 209 | |
| 210 Node* IntrinsicsGenerator::IsJSSet(Node* input, Node* arg_count, | |
| 211 Node* context) { | |
| 212 return IsInstanceType(input, JS_SET_TYPE); | |
| 213 } | |
| 214 | |
| 215 Node* IntrinsicsGenerator::IsJSSetIterator(Node* input, Node* arg_count, | |
| 216 Node* context) { | |
| 217 return IsInstanceType(input, JS_SET_ITERATOR_TYPE); | |
| 218 } | |
| 219 | |
| 220 Node* IntrinsicsGenerator::IsJSWeakMap(Node* input, Node* arg_count, | |
| 221 Node* context) { | |
| 222 return IsInstanceType(input, JS_WEAK_MAP_TYPE); | |
| 223 } | |
| 224 | |
| 225 Node* IntrinsicsGenerator::IsJSWeakSet(Node* input, Node* arg_count, | |
| 226 Node* context) { | |
| 227 return IsInstanceType(input, JS_WEAK_SET_TYPE); | |
| 228 } | |
| 229 | |
| 230 Node* IntrinsicsGenerator::IsSmi(Node* input, Node* arg_count, Node* context) { | 200 Node* IntrinsicsGenerator::IsSmi(Node* input, Node* arg_count, Node* context) { |
| 231 // TODO(ishell): Use SelectBooleanConstant here. | 201 // TODO(ishell): Use SelectBooleanConstant here. |
| 232 InterpreterAssembler::Variable return_value(assembler_, | 202 InterpreterAssembler::Variable return_value(assembler_, |
| 233 MachineRepresentation::kTagged); | 203 MachineRepresentation::kTagged); |
| 234 InterpreterAssembler::Label if_smi(assembler_), if_not_smi(assembler_), | 204 InterpreterAssembler::Label if_smi(assembler_), if_not_smi(assembler_), |
| 235 end(assembler_); | 205 end(assembler_); |
| 236 | 206 |
| 237 Node* arg = __ LoadRegister(input); | 207 Node* arg = __ LoadRegister(input); |
| 238 | 208 |
| 239 __ Branch(__ TaggedIsSmi(arg), &if_smi, &if_not_smi); | 209 __ Branch(__ TaggedIsSmi(arg), &if_smi, &if_not_smi); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 Node* comparison = __ Word32Equal(actual, __ Int32Constant(expected)); | 392 Node* comparison = __ Word32Equal(actual, __ Int32Constant(expected)); |
| 423 __ GotoIf(comparison, &match); | 393 __ GotoIf(comparison, &match); |
| 424 __ Abort(kWrongArgumentCountForInvokeIntrinsic); | 394 __ Abort(kWrongArgumentCountForInvokeIntrinsic); |
| 425 __ Goto(&match); | 395 __ Goto(&match); |
| 426 __ Bind(&match); | 396 __ Bind(&match); |
| 427 } | 397 } |
| 428 | 398 |
| 429 } // namespace interpreter | 399 } // namespace interpreter |
| 430 } // namespace internal | 400 } // namespace internal |
| 431 } // namespace v8 | 401 } // namespace v8 |
| OLD | NEW |