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

Unified Diff: src/code-stub-assembler.h

Issue 2126453002: [intrinsic] Drop the %_ValueOf intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix noi18n build (narf) Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.h
diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h
index f29701020791ffe5f67d9099c2236a2b4836d204..a3460f797e5385cfe76e29f55449a478f48181c1 100644
--- a/src/code-stub-assembler.h
+++ b/src/code-stub-assembler.h
@@ -17,6 +17,8 @@ class CallInterfaceDescriptor;
class StatsCounter;
class StubCache;
+enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
+
// Provides JavaScript-specific "macro-assembler" functionality on top of the
// CodeAssembler. By factoring the JavaScript-isms out of the CodeAssembler,
// it's possible to add JavaScript-specific useful CodeAssembler "macros"
@@ -251,6 +253,12 @@ class CodeStubAssembler : public compiler::CodeAssembler {
// or returns the {value} converted to a String otherwise.
compiler::Node* ToThisString(compiler::Node* context, compiler::Node* value,
char const* method_name);
+ // Throws a TypeError for {method_name} if {value} is neither of the given
+ // {primitive_type} nor a JSValue wrapping a value of {primitive_type}, or
+ // returns the {value} (or wrapped value) otherwise.
+ compiler::Node* ToThisValue(compiler::Node* context, compiler::Node* value,
+ PrimitiveType primitive_type,
+ char const* method_name);
// String helpers.
// Load a character from a String (might flatten a ConsString).
« no previous file with comments | « src/builtins.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698