OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 | 659 |
660 | 660 |
661 RUNTIME_FUNCTION(MaybeObject*, Runtime_WeakMapSet) { | 661 RUNTIME_FUNCTION(MaybeObject*, Runtime_WeakMapSet) { |
662 HandleScope scope(isolate); | 662 HandleScope scope(isolate); |
663 ASSERT(args.length() == 3); | 663 ASSERT(args.length() == 3); |
664 CONVERT_ARG_CHECKED(JSWeakMap, weakmap, 0); | 664 CONVERT_ARG_CHECKED(JSWeakMap, weakmap, 0); |
665 // TODO(mstarzinger): See Runtime_WeakMapGet above. | 665 // TODO(mstarzinger): See Runtime_WeakMapGet above. |
666 CONVERT_ARG_CHECKED(JSObject, key, 1); | 666 CONVERT_ARG_CHECKED(JSObject, key, 1); |
667 Handle<Object> value(args[2]); | 667 Handle<Object> value(args[2]); |
668 Handle<ObjectHashTable> table(weakmap->table()); | 668 Handle<ObjectHashTable> table(weakmap->table()); |
669 weakmap->set_table(*PutIntoObjectHashTable(table, key, value)); | 669 Handle<ObjectHashTable> new_table = PutIntoObjectHashTable(table, key, value); |
| 670 weakmap->set_table(*new_table); |
670 return *value; | 671 return *value; |
671 } | 672 } |
672 | 673 |
673 | 674 |
674 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClassOf) { | 675 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClassOf) { |
675 NoHandleAllocation ha; | 676 NoHandleAllocation ha; |
676 ASSERT(args.length() == 1); | 677 ASSERT(args.length() == 1); |
677 Object* obj = args[0]; | 678 Object* obj = args[0]; |
678 if (!obj->IsJSObject()) return isolate->heap()->null_value(); | 679 if (!obj->IsJSObject()) return isolate->heap()->null_value(); |
679 return JSObject::cast(obj)->class_name(); | 680 return JSObject::cast(obj)->class_name(); |
(...skipping 12141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12821 } else { | 12822 } else { |
12822 // Handle last resort GC and make sure to allow future allocations | 12823 // Handle last resort GC and make sure to allow future allocations |
12823 // to grow the heap without causing GCs (if possible). | 12824 // to grow the heap without causing GCs (if possible). |
12824 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12825 isolate->counters()->gc_last_resort_from_js()->Increment(); |
12825 isolate->heap()->CollectAllGarbage(false); | 12826 isolate->heap()->CollectAllGarbage(false); |
12826 } | 12827 } |
12827 } | 12828 } |
12828 | 12829 |
12829 | 12830 |
12830 } } // namespace v8::internal | 12831 } } // namespace v8::internal |
OLD | NEW |