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

Side by Side Diff: src/heap.cc

Issue 10103035: Share optimized code for closures. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: added x64 and ARM ports Created 8 years, 7 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 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 2984 matching lines...) Expand 10 before | Expand all | Expand 10 after
2995 2995
2996 MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) { 2996 MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) {
2997 SharedFunctionInfo* share; 2997 SharedFunctionInfo* share;
2998 MaybeObject* maybe = Allocate(shared_function_info_map(), OLD_POINTER_SPACE); 2998 MaybeObject* maybe = Allocate(shared_function_info_map(), OLD_POINTER_SPACE);
2999 if (!maybe->To<SharedFunctionInfo>(&share)) return maybe; 2999 if (!maybe->To<SharedFunctionInfo>(&share)) return maybe;
3000 3000
3001 // Set pointer fields. 3001 // Set pointer fields.
3002 share->set_name(name); 3002 share->set_name(name);
3003 Code* illegal = isolate_->builtins()->builtin(Builtins::kIllegal); 3003 Code* illegal = isolate_->builtins()->builtin(Builtins::kIllegal);
3004 share->set_code(illegal); 3004 share->set_code(illegal);
3005 share->set_optimized_code_map(Smi::FromInt(0));
Michael Starzinger 2012/05/23 11:16:29 Would it be possible to set this to the empty fixe
3005 share->set_scope_info(ScopeInfo::Empty()); 3006 share->set_scope_info(ScopeInfo::Empty());
3006 Code* construct_stub = 3007 Code* construct_stub =
3007 isolate_->builtins()->builtin(Builtins::kJSConstructStubGeneric); 3008 isolate_->builtins()->builtin(Builtins::kJSConstructStubGeneric);
3008 share->set_construct_stub(construct_stub); 3009 share->set_construct_stub(construct_stub);
3009 share->set_instance_class_name(Object_symbol()); 3010 share->set_instance_class_name(Object_symbol());
3010 share->set_function_data(undefined_value(), SKIP_WRITE_BARRIER); 3011 share->set_function_data(undefined_value(), SKIP_WRITE_BARRIER);
3011 share->set_script(undefined_value(), SKIP_WRITE_BARRIER); 3012 share->set_script(undefined_value(), SKIP_WRITE_BARRIER);
3012 share->set_debug_info(undefined_value(), SKIP_WRITE_BARRIER); 3013 share->set_debug_info(undefined_value(), SKIP_WRITE_BARRIER);
3013 share->set_inferred_name(empty_string(), SKIP_WRITE_BARRIER); 3014 share->set_inferred_name(empty_string(), SKIP_WRITE_BARRIER);
3014 share->set_initial_map(undefined_value(), SKIP_WRITE_BARRIER); 3015 share->set_initial_map(undefined_value(), SKIP_WRITE_BARRIER);
(...skipping 4114 matching lines...) Expand 10 before | Expand all | Expand 10 after
7129 } else { 7130 } else {
7130 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. 7131 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died.
7131 } 7132 }
7132 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = 7133 remembered_unmapped_pages_[remembered_unmapped_pages_index_] =
7133 reinterpret_cast<Address>(p); 7134 reinterpret_cast<Address>(p);
7134 remembered_unmapped_pages_index_++; 7135 remembered_unmapped_pages_index_++;
7135 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; 7136 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages;
7136 } 7137 }
7137 7138
7138 } } // namespace v8::internal 7139 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698