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

Side by Side Diff: src/heap.cc

Issue 23584004: Remove OptimizedCodeEntry *sigh*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after
2817 native_context_map->set_dictionary_map(true); 2817 native_context_map->set_dictionary_map(true);
2818 native_context_map->set_visitor_id(StaticVisitorBase::kVisitNativeContext); 2818 native_context_map->set_visitor_id(StaticVisitorBase::kVisitNativeContext);
2819 set_native_context_map(native_context_map); 2819 set_native_context_map(native_context_map);
2820 2820
2821 { MaybeObject* maybe_obj = AllocateMap(SHARED_FUNCTION_INFO_TYPE, 2821 { MaybeObject* maybe_obj = AllocateMap(SHARED_FUNCTION_INFO_TYPE,
2822 SharedFunctionInfo::kAlignedSize); 2822 SharedFunctionInfo::kAlignedSize);
2823 if (!maybe_obj->ToObject(&obj)) return false; 2823 if (!maybe_obj->ToObject(&obj)) return false;
2824 } 2824 }
2825 set_shared_function_info_map(Map::cast(obj)); 2825 set_shared_function_info_map(Map::cast(obj));
2826 2826
2827 { MaybeObject* maybe_obj = AllocateMap(OPTIMIZED_CODE_ENTRY_TYPE,
2828 OptimizedCodeEntry::kAlignedSize);
2829 if (!maybe_obj->ToObject(&obj)) return false;
2830 }
2831 set_optimized_code_entry_map(Map::cast(obj));
2832
2833 { MaybeObject* maybe_obj = AllocateMap(JS_MESSAGE_OBJECT_TYPE, 2827 { MaybeObject* maybe_obj = AllocateMap(JS_MESSAGE_OBJECT_TYPE,
2834 JSMessageObject::kSize); 2828 JSMessageObject::kSize);
2835 if (!maybe_obj->ToObject(&obj)) return false; 2829 if (!maybe_obj->ToObject(&obj)) return false;
2836 } 2830 }
2837 set_message_object_map(Map::cast(obj)); 2831 set_message_object_map(Map::cast(obj));
2838 2832
2839 Map* external_map; 2833 Map* external_map;
2840 { MaybeObject* maybe_obj = 2834 { MaybeObject* maybe_obj =
2841 AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize + kPointerSize); 2835 AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize + kPointerSize);
2842 if (!maybe_obj->To(&external_map)) return false; 2836 if (!maybe_obj->To(&external_map)) return false;
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
3650 share->set_end_position(0); 3644 share->set_end_position(0);
3651 share->set_function_token_position(0); 3645 share->set_function_token_position(0);
3652 // All compiler hints default to false or 0. 3646 // All compiler hints default to false or 0.
3653 share->set_compiler_hints(0); 3647 share->set_compiler_hints(0);
3654 share->set_opt_count(0); 3648 share->set_opt_count(0);
3655 3649
3656 return share; 3650 return share;
3657 } 3651 }
3658 3652
3659 3653
3660 MaybeObject* Heap::AllocateOptimizedCodeEntry(
3661 Context* native_context,
3662 JSFunction* function,
3663 Code* code,
3664 FixedArray* literals) {
3665 OptimizedCodeEntry* entry;
3666 MaybeObject* maybe = Allocate(optimized_code_entry_map(), OLD_POINTER_SPACE);
3667 if (!maybe->To<OptimizedCodeEntry>(&entry)) return maybe;
3668
3669 // Set pointer fields.
3670 entry->set_native_context(native_context);
3671 entry->set_function(function);
3672 entry->set_code(code);
3673 entry->set_literals(literals);
3674
3675 // NULL-out link fields.
3676 entry->set_next_by_shared_info(NULL, SKIP_WRITE_BARRIER);
3677 entry->set_next_by_native_context(NULL, SKIP_WRITE_BARRIER);
3678 entry->set_cacheable(false);
3679
3680 return entry;
3681 }
3682
3683
3684 MaybeObject* Heap::AllocateJSMessageObject(String* type, 3654 MaybeObject* Heap::AllocateJSMessageObject(String* type,
3685 JSArray* arguments, 3655 JSArray* arguments,
3686 int start_position, 3656 int start_position,
3687 int end_position, 3657 int end_position,
3688 Object* script, 3658 Object* script,
3689 Object* stack_trace, 3659 Object* stack_trace,
3690 Object* stack_frames) { 3660 Object* stack_frames) {
3691 Object* result; 3661 Object* result;
3692 { MaybeObject* maybe_result = Allocate(message_object_map(), NEW_SPACE); 3662 { MaybeObject* maybe_result = Allocate(message_object_map(), NEW_SPACE);
3693 if (!maybe_result->ToObject(&result)) return maybe_result; 3663 if (!maybe_result->ToObject(&result)) return maybe_result;
(...skipping 4389 matching lines...) Expand 10 before | Expand all | Expand 10 after
8083 if (FLAG_concurrent_recompilation) { 8053 if (FLAG_concurrent_recompilation) {
8084 heap_->relocation_mutex_->Lock(); 8054 heap_->relocation_mutex_->Lock();
8085 #ifdef DEBUG 8055 #ifdef DEBUG
8086 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8056 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8087 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8057 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8088 #endif // DEBUG 8058 #endif // DEBUG
8089 } 8059 }
8090 } 8060 }
8091 8061
8092 } } // namespace v8::internal 8062 } } // 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