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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 12957004: ES6 symbols: turn symbols into a proper primitive type (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/full-codegen-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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 if (types_.Contains(STRING)) { 625 if (types_.Contains(STRING)) {
626 // String value -> false iff empty. 626 // String value -> false iff empty.
627 Label not_string; 627 Label not_string;
628 __ CmpInstanceType(map, FIRST_NONSTRING_TYPE); 628 __ CmpInstanceType(map, FIRST_NONSTRING_TYPE);
629 __ j(above_equal, &not_string, Label::kNear); 629 __ j(above_equal, &not_string, Label::kNear);
630 __ mov(tos_, FieldOperand(argument, String::kLengthOffset)); 630 __ mov(tos_, FieldOperand(argument, String::kLengthOffset));
631 __ ret(1 * kPointerSize); // the string length is OK as the return value 631 __ ret(1 * kPointerSize); // the string length is OK as the return value
632 __ bind(&not_string); 632 __ bind(&not_string);
633 } 633 }
634 634
635 if (types_.Contains(SYMBOL)) {
636 // Symbol value -> true.
637 Label not_symbol;
638 __ CmpInstanceType(map, SYMBOL_TYPE);
639 __ j(not_equal, &not_symbol, Label::kNear);
640 __ bind(&not_symbol);
641 }
642
635 if (types_.Contains(HEAP_NUMBER)) { 643 if (types_.Contains(HEAP_NUMBER)) {
636 // heap number -> false iff +0, -0, or NaN. 644 // heap number -> false iff +0, -0, or NaN.
637 Label not_heap_number, false_result; 645 Label not_heap_number, false_result;
638 __ cmp(map, factory->heap_number_map()); 646 __ cmp(map, factory->heap_number_map());
639 __ j(not_equal, &not_heap_number, Label::kNear); 647 __ j(not_equal, &not_heap_number, Label::kNear);
640 __ fldz(); 648 __ fldz();
641 __ fld_d(FieldOperand(argument, HeapNumber::kValueOffset)); 649 __ fld_d(FieldOperand(argument, HeapNumber::kValueOffset));
642 __ FCmp(); 650 __ FCmp();
643 __ j(zero, &false_result, Label::kNear); 651 __ j(zero, &false_result, Label::kNear);
644 // argument contains the correct return value already. 652 // argument contains the correct return value already.
(...skipping 7226 matching lines...) Expand 10 before | Expand all | Expand 10 after
7871 // Restore ecx. 7879 // Restore ecx.
7872 __ pop(ecx); 7880 __ pop(ecx);
7873 __ ret(0); 7881 __ ret(0);
7874 } 7882 }
7875 7883
7876 #undef __ 7884 #undef __
7877 7885
7878 } } // namespace v8::internal 7886 } } // namespace v8::internal
7879 7887
7880 #endif // V8_TARGET_ARCH_IA32 7888 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698