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

Side by Side Diff: src/factory.cc

Issue 115081: Allocate proxy before the script to allow heap verification... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // Increment id, wrap when positive smi is exhausted. 160 // Increment id, wrap when positive smi is exhausted.
161 id = Smi::cast(Heap::last_script_id())->value(); 161 id = Smi::cast(Heap::last_script_id())->value();
162 id++; 162 id++;
163 if (!Smi::IsValid(id)) { 163 if (!Smi::IsValid(id)) {
164 id = 0; 164 id = 0;
165 } 165 }
166 } 166 }
167 Heap::SetLastScriptId(Smi::FromInt(id)); 167 Heap::SetLastScriptId(Smi::FromInt(id));
168 168
169 // Create and initialize script object. 169 // Create and initialize script object.
170 Handle<Proxy> wrapper = Factory::NewProxy(0, TENURED);
170 Handle<Script> script = Handle<Script>::cast(NewStruct(SCRIPT_TYPE)); 171 Handle<Script> script = Handle<Script>::cast(NewStruct(SCRIPT_TYPE));
171 script->set_source(*source); 172 script->set_source(*source);
172 script->set_name(Heap::undefined_value()); 173 script->set_name(Heap::undefined_value());
173 script->set_id(Heap::last_script_id()); 174 script->set_id(Heap::last_script_id());
174 script->set_line_offset(Smi::FromInt(0)); 175 script->set_line_offset(Smi::FromInt(0));
175 script->set_column_offset(Smi::FromInt(0)); 176 script->set_column_offset(Smi::FromInt(0));
176 script->set_data(Heap::undefined_value()); 177 script->set_data(Heap::undefined_value());
177 script->set_context_data(Heap::undefined_value()); 178 script->set_context_data(Heap::undefined_value());
178 script->set_type(Smi::FromInt(SCRIPT_TYPE_NORMAL)); 179 script->set_type(Smi::FromInt(SCRIPT_TYPE_NORMAL));
179 script->set_wrapper(*Factory::NewProxy(0, TENURED)); 180 script->set_wrapper(*wrapper);
180 script->set_line_ends(Heap::undefined_value()); 181 script->set_line_ends(Heap::undefined_value());
181 182
182 return script; 183 return script;
183 } 184 }
184 185
185 186
186 Handle<Proxy> Factory::NewProxy(Address addr, PretenureFlag pretenure) { 187 Handle<Proxy> Factory::NewProxy(Address addr, PretenureFlag pretenure) {
187 CALL_HEAP_FUNCTION(Heap::AllocateProxy(addr, pretenure), Proxy); 188 CALL_HEAP_FUNCTION(Heap::AllocateProxy(addr, pretenure), Proxy);
188 } 189 }
189 190
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 Execution::ConfigureInstance(instance, 898 Execution::ConfigureInstance(instance,
898 instance_template, 899 instance_template,
899 pending_exception); 900 pending_exception);
900 } else { 901 } else {
901 *pending_exception = false; 902 *pending_exception = false;
902 } 903 }
903 } 904 }
904 905
905 906
906 } } // namespace v8::internal 907 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698