Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: src/code-stub-assembler.cc

Issue 2814043006: [errors] Improve NotGeneric error message (Closed)
Patch Set: Address comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/builtins/builtins-number.cc ('k') | src/messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
2903 // The {value} is not a compatible receiver for this method. 2920 // The {value} is not a compatible receiver for this method.
2904 CallRuntime(Runtime::kThrowNotGeneric, context, 2921 CallRuntime(Runtime::kThrowTypeError, context,
2905 HeapConstant(factory()->NewStringFromAsciiChecked(method_name, 2922 SmiConstant(MessageTemplate::kNotGeneric),
2906 TENURED))); 2923 CStringConstant(method_name), CStringConstant(primitive_name));
2907 Unreachable(); 2924 Unreachable();
2908 } 2925 }
2909 2926
2910 BIND(&done_loop); 2927 BIND(&done_loop);
2911 return var_value.value(); 2928 return var_value.value();
2912 } 2929 }
2913 2930
2914 Node* CodeStubAssembler::ThrowIfNotInstanceType(Node* context, Node* value, 2931 Node* CodeStubAssembler::ThrowIfNotInstanceType(Node* context, Node* value,
2915 InstanceType instance_type, 2932 InstanceType instance_type,
2916 char const* method_name) { 2933 char const* method_name) {
(...skipping 5656 matching lines...) Expand 10 before | Expand all | Expand 10 after
8573 formatted.c_str(), TENURED); 8590 formatted.c_str(), TENURED);
8574 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), 8591 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(),
8575 HeapConstant(string)); 8592 HeapConstant(string));
8576 } 8593 }
8577 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); 8594 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value);
8578 #endif 8595 #endif
8579 } 8596 }
8580 8597
8581 } // namespace internal 8598 } // namespace internal
8582 } // namespace v8 8599 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-number.cc ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698