OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 | 96 |
97 static Handle<JSFunction> MakeFunction(bool is_global, | 97 static Handle<JSFunction> MakeFunction(bool is_global, |
98 bool is_eval, | 98 bool is_eval, |
99 bool is_json, | 99 bool is_json, |
100 Handle<Script> script, | 100 Handle<Script> script, |
101 Handle<Context> context, | 101 Handle<Context> context, |
102 v8::Extension* extension, | 102 v8::Extension* extension, |
103 ScriptDataImpl* pre_data) { | 103 ScriptDataImpl* pre_data) { |
104 ZoneScope zone_scope(DELETE_ON_EXIT); | 104 CompilationZoneScope zone_scope(DELETE_ON_EXIT); |
105 | 105 |
106 // Make sure we have an initial stack limit. | 106 // Make sure we have an initial stack limit. |
107 StackGuard guard; | 107 StackGuard guard; |
108 PostponeInterruptsScope postpone; | 108 PostponeInterruptsScope postpone; |
109 | 109 |
110 ASSERT(!i::Top::global_context().is_null()); | 110 ASSERT(!i::Top::global_context().is_null()); |
111 script->set_context_data((*i::Top::global_context())->data()); | 111 script->set_context_data((*i::Top::global_context())->data()); |
112 #ifdef ENABLE_DEBUGGER_SUPPORT | 112 #ifdef ENABLE_DEBUGGER_SUPPORT |
113 // Notify debugger | 113 // Notify debugger |
114 Debugger::OnBeforeCompile(script); | 114 Debugger::OnBeforeCompile(script); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 CompilationCache::PutEval(source, context, entry, result); | 299 CompilationCache::PutEval(source, context, entry, result); |
300 } | 300 } |
301 } | 301 } |
302 | 302 |
303 return result; | 303 return result; |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared, | 307 bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared, |
308 int loop_nesting) { | 308 int loop_nesting) { |
309 ZoneScope zone_scope(DELETE_ON_EXIT); | 309 CompilationZoneScope zone_scope(DELETE_ON_EXIT); |
310 | 310 |
311 // The VM is in the COMPILER state until exiting this function. | 311 // The VM is in the COMPILER state until exiting this function. |
312 VMState state(COMPILER); | 312 VMState state(COMPILER); |
313 | 313 |
314 // Make sure we have an initial stack limit. | 314 // Make sure we have an initial stack limit. |
315 StackGuard guard; | 315 StackGuard guard; |
316 PostponeInterruptsScope postpone; | 316 PostponeInterruptsScope postpone; |
317 | 317 |
318 // Compute name, source code and script data. | 318 // Compute name, source code and script data. |
319 Handle<String> name(String::cast(shared->name())); | 319 Handle<String> name(String::cast(shared->name())); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 // Set the expected number of properties for instances. | 386 // Set the expected number of properties for instances. |
387 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); | 387 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); |
388 | 388 |
389 // Check the function has compiled code. | 389 // Check the function has compiled code. |
390 ASSERT(shared->is_compiled()); | 390 ASSERT(shared->is_compiled()); |
391 return true; | 391 return true; |
392 } | 392 } |
393 | 393 |
394 | 394 |
395 } } // namespace v8::internal | 395 } } // namespace v8::internal |
OLD | NEW |