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 #include "src/code-stub-assembler.h" | 4 #include "src/code-stub-assembler.h" |
5 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/frames-inl.h" | 6 #include "src/frames-inl.h" |
7 #include "src/frames.h" | 7 #include "src/frames.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 2882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2893 GotoIf(Word32Equal(value_instance_type, Int32Constant(SYMBOL_TYPE)), | 2893 GotoIf(Word32Equal(value_instance_type, Int32Constant(SYMBOL_TYPE)), |
2894 &done_loop); | 2894 &done_loop); |
2895 break; | 2895 break; |
2896 } | 2896 } |
2897 Goto(&done_throw); | 2897 Goto(&done_throw); |
2898 } | 2898 } |
2899 } | 2899 } |
2900 | 2900 |
2901 BIND(&done_throw); | 2901 BIND(&done_throw); |
2902 { | 2902 { |
2903 const char* primitive_name = nullptr; | |
2904 switch (primitive_type) { | |
2905 case PrimitiveType::kBoolean: | |
2906 primitive_name = "Boolean"; | |
2907 break; | |
2908 case PrimitiveType::kNumber: | |
2909 primitive_name = "Number"; | |
2910 break; | |
2911 case PrimitiveType::kString: | |
2912 primitive_name = "String"; | |
2913 break; | |
2914 case PrimitiveType::kSymbol: | |
2915 primitive_name = "Symbol"; | |
2916 break; | |
2917 } | |
2918 CHECK_NOT_NULL(primitive_name); | |
2919 | |
2920 // The {value} is not a compatible receiver for this method. | 2903 // The {value} is not a compatible receiver for this method. |
2921 CallRuntime(Runtime::kThrowTypeError, context, | 2904 CallRuntime(Runtime::kThrowNotGeneric, context, |
2922 SmiConstant(MessageTemplate::kNotGeneric), | 2905 HeapConstant(factory()->NewStringFromAsciiChecked(method_name, |
2923 CStringConstant(method_name), CStringConstant(primitive_name)); | 2906 TENURED))); |
2924 Unreachable(); | 2907 Unreachable(); |
2925 } | 2908 } |
2926 | 2909 |
2927 BIND(&done_loop); | 2910 BIND(&done_loop); |
2928 return var_value.value(); | 2911 return var_value.value(); |
2929 } | 2912 } |
2930 | 2913 |
2931 Node* CodeStubAssembler::ThrowIfNotInstanceType(Node* context, Node* value, | 2914 Node* CodeStubAssembler::ThrowIfNotInstanceType(Node* context, Node* value, |
2932 InstanceType instance_type, | 2915 InstanceType instance_type, |
2933 char const* method_name) { | 2916 char const* method_name) { |
(...skipping 5656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8590 formatted.c_str(), TENURED); | 8573 formatted.c_str(), TENURED); |
8591 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8574 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
8592 HeapConstant(string)); | 8575 HeapConstant(string)); |
8593 } | 8576 } |
8594 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 8577 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
8595 #endif | 8578 #endif |
8596 } | 8579 } |
8597 | 8580 |
8598 } // namespace internal | 8581 } // namespace internal |
8599 } // namespace v8 | 8582 } // namespace v8 |
OLD | NEW |