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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 118553003: Upgrade Symbol implementation to match current ES6 behavior. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Remove uninteresting equality test Created 6 years, 11 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
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index a36f4b1c6c06074f104e4ee2ef8856a196e096b5..25539b045db98de43378f558a935b61f0cb268d0 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -2270,6 +2270,15 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
if (CallAsMethod()) {
if (NeedsChecks()) {
+ // FIXME: expedient but expensive; surely a better way?
+ // Always call ToObject() on symbol values.
+ Label not_a_symbol;
+ __ movp(rax, Operand(rsp, (argc_ + 1) * kPointerSize));
+ __ JumpIfSmi(rax, &not_a_symbol, Label::kNear);
+ __ CmpObjectType(rax, SYMBOL_TYPE, rcx);
+ __ j(equal, &wrap);
+
+ __ bind(&not_a_symbol);
// Do not transform the receiver for strict mode functions.
__ movp(rcx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
__ testb(FieldOperand(rcx, SharedFunctionInfo::kStrictModeByteOffset),

Powered by Google App Engine
This is Rietveld 408576698