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

Side by Side Diff: src/heap.cc

Issue 6606002: Merge revision 6500-6600 from bleeding_edge to the isolates branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
1795 Map* global_context_map = Map::cast(obj); 1795 Map* global_context_map = Map::cast(obj);
1796 global_context_map->set_visitor_id(StaticVisitorBase::kVisitGlobalContext); 1796 global_context_map->set_visitor_id(StaticVisitorBase::kVisitGlobalContext);
1797 set_global_context_map(global_context_map); 1797 set_global_context_map(global_context_map);
1798 1798
1799 { MaybeObject* maybe_obj = AllocateMap(SHARED_FUNCTION_INFO_TYPE, 1799 { MaybeObject* maybe_obj = AllocateMap(SHARED_FUNCTION_INFO_TYPE,
1800 SharedFunctionInfo::kAlignedSize); 1800 SharedFunctionInfo::kAlignedSize);
1801 if (!maybe_obj->ToObject(&obj)) return false; 1801 if (!maybe_obj->ToObject(&obj)) return false;
1802 } 1802 }
1803 set_shared_function_info_map(Map::cast(obj)); 1803 set_shared_function_info_map(Map::cast(obj));
1804 1804
1805 { MaybeObject* maybe_obj = AllocateMap(JS_MESSAGE_OBJECT_TYPE,
1806 JSMessageObject::kSize);
1807 if (!maybe_obj->ToObject(&obj)) return false;
1808 }
1809 set_message_object_map(Map::cast(obj));
1810
1805 ASSERT(!InNewSpace(empty_fixed_array())); 1811 ASSERT(!InNewSpace(empty_fixed_array()));
1806 return true; 1812 return true;
1807 } 1813 }
1808 1814
1809 1815
1810 MaybeObject* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) { 1816 MaybeObject* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) {
1811 // Statically ensure that it is safe to allocate heap numbers in paged 1817 // Statically ensure that it is safe to allocate heap numbers in paged
1812 // spaces. 1818 // spaces.
1813 STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxHeapObjectSize); 1819 STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxHeapObjectSize);
1814 AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE; 1820 AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2313 share->set_this_property_assignments_count(0); 2319 share->set_this_property_assignments_count(0);
2314 share->set_this_property_assignments(undefined_value()); 2320 share->set_this_property_assignments(undefined_value());
2315 share->set_opt_count(0); 2321 share->set_opt_count(0);
2316 share->set_num_literals(0); 2322 share->set_num_literals(0);
2317 share->set_end_position(0); 2323 share->set_end_position(0);
2318 share->set_function_token_position(0); 2324 share->set_function_token_position(0);
2319 return result; 2325 return result;
2320 } 2326 }
2321 2327
2322 2328
2329 MaybeObject* Heap::AllocateJSMessageObject(String* type,
2330 JSArray* arguments,
2331 int start_position,
2332 int end_position,
2333 Object* script,
2334 Object* stack_trace,
2335 Object* stack_frames) {
2336 Object* result;
2337 { MaybeObject* maybe_result = Allocate(message_object_map(), NEW_SPACE);
2338 if (!maybe_result->ToObject(&result)) return maybe_result;
2339 }
2340 JSMessageObject* message = JSMessageObject::cast(result);
2341 message->set_properties(Heap::empty_fixed_array());
2342 message->set_elements(Heap::empty_fixed_array());
2343 message->set_type(type);
2344 message->set_arguments(arguments);
2345 message->set_start_position(start_position);
2346 message->set_end_position(end_position);
2347 message->set_script(script);
2348 message->set_stack_trace(stack_trace);
2349 message->set_stack_frames(stack_frames);
2350 return result;
2351 }
2352
2353
2354
2323 // Returns true for a character in a range. Both limits are inclusive. 2355 // Returns true for a character in a range. Both limits are inclusive.
2324 static inline bool Between(uint32_t character, uint32_t from, uint32_t to) { 2356 static inline bool Between(uint32_t character, uint32_t from, uint32_t to) {
2325 // This makes uses of the the unsigned wraparound. 2357 // This makes uses of the the unsigned wraparound.
2326 return character - from <= to - from; 2358 return character - from <= to - from;
2327 } 2359 }
2328 2360
2329 2361
2330 MUST_USE_RESULT static inline MaybeObject* MakeOrFindTwoCharacterString( 2362 MUST_USE_RESULT static inline MaybeObject* MakeOrFindTwoCharacterString(
2331 Heap* heap, 2363 Heap* heap,
2332 uint32_t c1, 2364 uint32_t c1,
(...skipping 3275 matching lines...) Expand 10 before | Expand all | Expand 10 after
5608 } 5640 }
5609 5641
5610 5642
5611 void ExternalStringTable::TearDown() { 5643 void ExternalStringTable::TearDown() {
5612 new_space_strings_.Free(); 5644 new_space_strings_.Free();
5613 old_space_strings_.Free(); 5645 old_space_strings_.Free();
5614 } 5646 }
5615 5647
5616 5648
5617 } } // namespace v8::internal 5649 } } // namespace v8::internal
OLDNEW
« src/ast.cc ('K') | « src/heap.h ('k') | src/heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698