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

Side by Side Diff: src/heap.cc

Issue 16562003: Allow smis for singleton types (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments Created 7 years, 6 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/heap.h ('k') | src/objects.h » ('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 2683 matching lines...) Expand 10 before | Expand all | Expand 10 after
2694 { MaybeObject* maybe_result = AllocateRawCell(); 2694 { MaybeObject* maybe_result = AllocateRawCell();
2695 if (!maybe_result->ToObject(&result)) return maybe_result; 2695 if (!maybe_result->ToObject(&result)) return maybe_result;
2696 } 2696 }
2697 HeapObject::cast(result)->set_map_no_write_barrier( 2697 HeapObject::cast(result)->set_map_no_write_barrier(
2698 global_property_cell_map()); 2698 global_property_cell_map());
2699 JSGlobalPropertyCell::cast(result)->set_value(value); 2699 JSGlobalPropertyCell::cast(result)->set_value(value);
2700 return result; 2700 return result;
2701 } 2701 }
2702 2702
2703 2703
2704 MaybeObject* Heap::AllocateBox(Object* value, PretenureFlag pretenure) {
2705 Box* result;
2706 MaybeObject* maybe_result = AllocateStruct(BOX_TYPE);
2707 if (!maybe_result->To(&result)) return maybe_result;
2708 result->set_value(value);
2709 return result;
2710 }
2711
2712
2704 MaybeObject* Heap::CreateOddball(const char* to_string, 2713 MaybeObject* Heap::CreateOddball(const char* to_string,
2705 Object* to_number, 2714 Object* to_number,
2706 byte kind) { 2715 byte kind) {
2707 Object* result; 2716 Object* result;
2708 { MaybeObject* maybe_result = Allocate(oddball_map(), OLD_POINTER_SPACE); 2717 { MaybeObject* maybe_result = Allocate(oddball_map(), OLD_POINTER_SPACE);
2709 if (!maybe_result->ToObject(&result)) return maybe_result; 2718 if (!maybe_result->ToObject(&result)) return maybe_result;
2710 } 2719 }
2711 return Oddball::cast(result)->Initialize(to_string, to_number, kind); 2720 return Oddball::cast(result)->Initialize(to_string, to_number, kind);
2712 } 2721 }
2713 2722
(...skipping 5182 matching lines...) Expand 10 before | Expand all | Expand 10 after
7896 if (FLAG_parallel_recompilation) { 7905 if (FLAG_parallel_recompilation) {
7897 heap_->relocation_mutex_->Lock(); 7906 heap_->relocation_mutex_->Lock();
7898 #ifdef DEBUG 7907 #ifdef DEBUG
7899 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7908 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7900 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7909 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7901 #endif // DEBUG 7910 #endif // DEBUG
7902 } 7911 }
7903 } 7912 }
7904 7913
7905 } } // namespace v8::internal 7914 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698