OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 { | 1054 { |
1055 Label rhs_is_smi(assembler), rhs_is_not_smi(assembler); | 1055 Label rhs_is_smi(assembler), rhs_is_not_smi(assembler); |
1056 assembler->Branch(assembler->TaggedIsSmi(rhs), &rhs_is_smi, | 1056 assembler->Branch(assembler->TaggedIsSmi(rhs), &rhs_is_smi, |
1057 &rhs_is_not_smi); | 1057 &rhs_is_not_smi); |
1058 | 1058 |
1059 assembler->Bind(&rhs_is_smi); | 1059 assembler->Bind(&rhs_is_smi); |
1060 { | 1060 { |
1061 // Both {lhs} and {rhs} are Smis. The result is not necessarily a smi, | 1061 // Both {lhs} and {rhs} are Smis. The result is not necessarily a smi, |
1062 // in case of overflow. | 1062 // in case of overflow. |
1063 var_result.Bind(assembler->SmiMul(lhs, rhs)); | 1063 var_result.Bind(assembler->SmiMul(lhs, rhs)); |
1064 var_type_feedback.Bind(assembler->Select( | 1064 var_type_feedback.Bind(assembler->SelectInt32Constant( |
1065 assembler->TaggedIsSmi(var_result.value()), | 1065 assembler->TaggedIsSmi(var_result.value()), |
1066 assembler->Int32Constant(BinaryOperationFeedback::kSignedSmall), | 1066 BinaryOperationFeedback::kSignedSmall, |
1067 assembler->Int32Constant(BinaryOperationFeedback::kNumber), | 1067 BinaryOperationFeedback::kNumber)); |
1068 MachineRepresentation::kWord32)); | |
1069 assembler->Goto(&end); | 1068 assembler->Goto(&end); |
1070 } | 1069 } |
1071 | 1070 |
1072 assembler->Bind(&rhs_is_not_smi); | 1071 assembler->Bind(&rhs_is_not_smi); |
1073 { | 1072 { |
1074 Node* rhs_map = assembler->LoadMap(rhs); | 1073 Node* rhs_map = assembler->LoadMap(rhs); |
1075 | 1074 |
1076 // Check if {rhs} is a HeapNumber. | 1075 // Check if {rhs} is a HeapNumber. |
1077 assembler->GotoUnless(assembler->IsHeapNumberMap(rhs_map), | 1076 assembler->GotoUnless(assembler->IsHeapNumberMap(rhs_map), |
1078 &check_rhsisoddball); | 1077 &check_rhsisoddball); |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 | 1434 |
1436 assembler->Bind(÷nd_is_smi); | 1435 assembler->Bind(÷nd_is_smi); |
1437 { | 1436 { |
1438 Label divisor_is_smi(assembler), divisor_is_not_smi(assembler); | 1437 Label divisor_is_smi(assembler), divisor_is_not_smi(assembler); |
1439 assembler->Branch(assembler->TaggedIsSmi(divisor), &divisor_is_smi, | 1438 assembler->Branch(assembler->TaggedIsSmi(divisor), &divisor_is_smi, |
1440 &divisor_is_not_smi); | 1439 &divisor_is_not_smi); |
1441 | 1440 |
1442 assembler->Bind(&divisor_is_smi); | 1441 assembler->Bind(&divisor_is_smi); |
1443 { | 1442 { |
1444 var_result.Bind(assembler->SmiMod(dividend, divisor)); | 1443 var_result.Bind(assembler->SmiMod(dividend, divisor)); |
1445 var_type_feedback.Bind(assembler->Select( | 1444 var_type_feedback.Bind(assembler->SelectInt32Constant( |
1446 assembler->TaggedIsSmi(var_result.value()), | 1445 assembler->TaggedIsSmi(var_result.value()), |
1447 assembler->Int32Constant(BinaryOperationFeedback::kSignedSmall), | 1446 BinaryOperationFeedback::kSignedSmall, |
1448 assembler->Int32Constant(BinaryOperationFeedback::kNumber))); | 1447 BinaryOperationFeedback::kNumber)); |
1449 assembler->Goto(&end); | 1448 assembler->Goto(&end); |
1450 } | 1449 } |
1451 | 1450 |
1452 assembler->Bind(&divisor_is_not_smi); | 1451 assembler->Bind(&divisor_is_not_smi); |
1453 { | 1452 { |
1454 Node* divisor_map = assembler->LoadMap(divisor); | 1453 Node* divisor_map = assembler->LoadMap(divisor); |
1455 | 1454 |
1456 // Check if {divisor} is a HeapNumber. | 1455 // Check if {divisor} is a HeapNumber. |
1457 assembler->GotoUnless(assembler->IsHeapNumberMap(divisor_map), | 1456 assembler->GotoUnless(assembler->IsHeapNumberMap(divisor_map), |
1458 &check_divisor_for_oddball); | 1457 &check_divisor_for_oddball); |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2488 assembler->Int32Constant( | 2487 assembler->Int32Constant( |
2489 (FunctionKind::kAccessorFunction | | 2488 (FunctionKind::kAccessorFunction | |
2490 FunctionKind::kArrowFunction | | 2489 FunctionKind::kArrowFunction | |
2491 FunctionKind::kConciseMethod) | 2490 FunctionKind::kConciseMethod) |
2492 << SharedFunctionInfo::kFunctionKindShift))); | 2491 << SharedFunctionInfo::kFunctionKindShift))); |
2493 } | 2492 } |
2494 assembler->Goto(&if_function_without_prototype); | 2493 assembler->Goto(&if_function_without_prototype); |
2495 | 2494 |
2496 assembler->Bind(&if_normal); | 2495 assembler->Bind(&if_normal); |
2497 { | 2496 { |
2498 map_index.Bind(assembler->Select( | 2497 map_index.Bind(assembler->SelectIntPtrConstant( |
2499 is_strict, | 2498 is_strict, Context::STRICT_FUNCTION_MAP_INDEX, |
2500 assembler->IntPtrConstant(Context::STRICT_FUNCTION_MAP_INDEX), | 2499 Context::SLOPPY_FUNCTION_MAP_INDEX)); |
2501 assembler->IntPtrConstant(Context::SLOPPY_FUNCTION_MAP_INDEX))); | |
2502 assembler->Goto(&load_map); | 2500 assembler->Goto(&load_map); |
2503 } | 2501 } |
2504 | 2502 |
2505 assembler->Bind(&if_generator); | 2503 assembler->Bind(&if_generator); |
2506 { | 2504 { |
2507 map_index.Bind(assembler->Select( | 2505 map_index.Bind(assembler->SelectIntPtrConstant( |
2508 is_strict, | 2506 is_strict, Context::STRICT_GENERATOR_FUNCTION_MAP_INDEX, |
2509 assembler->IntPtrConstant(Context::STRICT_GENERATOR_FUNCTION_MAP_INDEX), | 2507 Context::SLOPPY_GENERATOR_FUNCTION_MAP_INDEX)); |
2510 assembler->IntPtrConstant( | |
2511 Context::SLOPPY_GENERATOR_FUNCTION_MAP_INDEX))); | |
2512 assembler->Goto(&load_map); | 2508 assembler->Goto(&load_map); |
2513 } | 2509 } |
2514 | 2510 |
2515 assembler->Bind(&if_async); | 2511 assembler->Bind(&if_async); |
2516 { | 2512 { |
2517 map_index.Bind(assembler->Select( | 2513 map_index.Bind(assembler->SelectIntPtrConstant( |
2518 is_strict, | 2514 is_strict, Context::STRICT_ASYNC_FUNCTION_MAP_INDEX, |
2519 assembler->IntPtrConstant(Context::STRICT_ASYNC_FUNCTION_MAP_INDEX), | 2515 Context::SLOPPY_ASYNC_FUNCTION_MAP_INDEX)); |
2520 assembler->IntPtrConstant(Context::SLOPPY_ASYNC_FUNCTION_MAP_INDEX))); | |
2521 assembler->Goto(&load_map); | 2516 assembler->Goto(&load_map); |
2522 } | 2517 } |
2523 | 2518 |
2524 assembler->Bind(&if_class_constructor); | 2519 assembler->Bind(&if_class_constructor); |
2525 { | 2520 { |
2526 map_index.Bind( | 2521 map_index.Bind( |
2527 assembler->IntPtrConstant(Context::STRICT_FUNCTION_MAP_INDEX)); | 2522 assembler->IntPtrConstant(Context::STRICT_FUNCTION_MAP_INDEX)); |
2528 assembler->Goto(&load_map); | 2523 assembler->Goto(&load_map); |
2529 } | 2524 } |
2530 | 2525 |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3203 } | 3198 } |
3204 | 3199 |
3205 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) | 3200 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
3206 : PlatformCodeStub(isolate) {} | 3201 : PlatformCodeStub(isolate) {} |
3207 | 3202 |
3208 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) | 3203 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) |
3209 : PlatformCodeStub(isolate) {} | 3204 : PlatformCodeStub(isolate) {} |
3210 | 3205 |
3211 } // namespace internal | 3206 } // namespace internal |
3212 } // namespace v8 | 3207 } // namespace v8 |
OLD | NEW |