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

Side by Side Diff: src/runtime.cc

Issue 118553003: Upgrade Symbol implementation to match current ES6 behavior. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Some test improvements. Created 6 years, 10 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/runtime.h ('k') | src/runtime.js » ('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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 Handle<Object> name(args[0], isolate); 626 Handle<Object> name(args[0], isolate);
627 RUNTIME_ASSERT(name->IsString() || name->IsUndefined()); 627 RUNTIME_ASSERT(name->IsString() || name->IsUndefined());
628 Symbol* symbol; 628 Symbol* symbol;
629 MaybeObject* maybe = isolate->heap()->AllocatePrivateSymbol(); 629 MaybeObject* maybe = isolate->heap()->AllocatePrivateSymbol();
630 if (!maybe->To(&symbol)) return maybe; 630 if (!maybe->To(&symbol)) return maybe;
631 if (name->IsString()) symbol->set_name(*name); 631 if (name->IsString()) symbol->set_name(*name);
632 return symbol; 632 return symbol;
633 } 633 }
634 634
635 635
636 RUNTIME_FUNCTION(MaybeObject*, Runtime_SymbolName) { 636 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewSymbolWrapper) {
637 ASSERT(args.length() == 1);
638 CONVERT_ARG_CHECKED(Symbol, symbol, 0);
639 return symbol->ToObject(isolate);
640 }
641
642
643 RUNTIME_FUNCTION(MaybeObject*, Runtime_SymbolDescription) {
637 SealHandleScope shs(isolate); 644 SealHandleScope shs(isolate);
638 ASSERT(args.length() == 1); 645 ASSERT(args.length() == 1);
639 CONVERT_ARG_CHECKED(Symbol, symbol, 0); 646 CONVERT_ARG_CHECKED(Symbol, symbol, 0);
640 return symbol->name(); 647 return symbol->name();
641 } 648 }
642 649
643 650
644 RUNTIME_FUNCTION(MaybeObject*, Runtime_SymbolIsPrivate) { 651 RUNTIME_FUNCTION(MaybeObject*, Runtime_SymbolIsPrivate) {
645 SealHandleScope shs(isolate); 652 SealHandleScope shs(isolate);
646 ASSERT(args.length() == 1); 653 ASSERT(args.length() == 1);
(...skipping 14213 matching lines...) Expand 10 before | Expand all | Expand 10 after
14860 // Handle last resort GC and make sure to allow future allocations 14867 // Handle last resort GC and make sure to allow future allocations
14861 // to grow the heap without causing GCs (if possible). 14868 // to grow the heap without causing GCs (if possible).
14862 isolate->counters()->gc_last_resort_from_js()->Increment(); 14869 isolate->counters()->gc_last_resort_from_js()->Increment();
14863 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14870 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14864 "Runtime::PerformGC"); 14871 "Runtime::PerformGC");
14865 } 14872 }
14866 } 14873 }
14867 14874
14868 14875
14869 } } // namespace v8::internal 14876 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698