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

Side by Side Diff: src/builtins/builtins-symbol-gen.cc

Issue 2900703002: [es2015] Precompute the descriptive string for symbols. (Closed)
Patch Set: Address feedback. Created 3 years, 7 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-symbol.cc ('k') | src/builtins/ia32/builtins-ia32.cc » ('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 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/builtins/builtins-utils-gen.h" 5 #include "src/builtins/builtins-utils-gen.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 #include "src/code-stub-assembler.h" 7 #include "src/code-stub-assembler.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 11 matching lines...) Expand all
22 Return(result); 22 Return(result);
23 } 23 }
24 24
25 // ES6 #sec-symbol.prototype.tostring 25 // ES6 #sec-symbol.prototype.tostring
26 TF_BUILTIN(SymbolPrototypeToString, CodeStubAssembler) { 26 TF_BUILTIN(SymbolPrototypeToString, CodeStubAssembler) {
27 Node* context = Parameter(Descriptor::kContext); 27 Node* context = Parameter(Descriptor::kContext);
28 Node* receiver = Parameter(Descriptor::kReceiver); 28 Node* receiver = Parameter(Descriptor::kReceiver);
29 29
30 Node* value = ToThisValue(context, receiver, PrimitiveType::kSymbol, 30 Node* value = ToThisValue(context, receiver, PrimitiveType::kSymbol,
31 "Symbol.prototype.toString"); 31 "Symbol.prototype.toString");
32 Node* result = CallRuntime(Runtime::kSymbolDescriptiveString, context, value); 32 Node* result = LoadObjectField(value, Symbol::kDescriptiveStringOffset);
33 Return(result); 33 Return(result);
34 } 34 }
35 35
36 // ES6 #sec-symbol.prototype.valueof 36 // ES6 #sec-symbol.prototype.valueof
37 TF_BUILTIN(SymbolPrototypeValueOf, CodeStubAssembler) { 37 TF_BUILTIN(SymbolPrototypeValueOf, CodeStubAssembler) {
38 Node* context = Parameter(Descriptor::kContext); 38 Node* context = Parameter(Descriptor::kContext);
39 Node* receiver = Parameter(Descriptor::kReceiver); 39 Node* receiver = Parameter(Descriptor::kReceiver);
40 40
41 Node* result = ToThisValue(context, receiver, PrimitiveType::kSymbol, 41 Node* result = ToThisValue(context, receiver, PrimitiveType::kSymbol,
42 "Symbol.prototype.valueOf"); 42 "Symbol.prototype.valueOf");
43 Return(result); 43 Return(result);
44 } 44 }
45 45
46 } // namespace internal 46 } // namespace internal
47 } // namespace v8 47 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-symbol.cc ('k') | src/builtins/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698