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

Unified Diff: src/ia32/code-stubs-ia32.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
« no previous file with comments | « src/hydrogen.cc ('k') | src/ic.cc » ('j') | src/symbol.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/code-stubs-ia32.cc
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
index e280c50e7937d30eb3344017332ee6156a5b33bb..fc32866c68c35a46c20d6ac59fbaa34657bca64e 100644
--- a/src/ia32/code-stubs-ia32.cc
+++ b/src/ia32/code-stubs-ia32.cc
@@ -2433,7 +2433,16 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
if (CallAsMethod()) {
if (NeedsChecks()) {
- // Do not transform the receiver for strict mode functions.
+ // FIXME: expedient but expensive; surely a better way?
+ // Always call ToObject() on symbol values.
+ Label not_a_symbol;
+ __ mov(eax, Operand(esp, (argc_ + 1) * kPointerSize));
+ __ JumpIfSmi(eax, &not_a_symbol, Label::kNear);
+ __ CmpObjectType(eax, SYMBOL_TYPE, ecx);
+ __ j(equal, &wrap);
+
+ __ bind(&not_a_symbol);
+ // Do not transform the receiver for strict mode functions.
__ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
__ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset),
1 << SharedFunctionInfo::kStrictModeBitWithinByte);
« no previous file with comments | « src/hydrogen.cc ('k') | src/ic.cc » ('j') | src/symbol.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698