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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 static Handle<JSFunction> MakeFunction(bool is_global, | 115 static Handle<JSFunction> MakeFunction(bool is_global, |
116 bool is_eval, | 116 bool is_eval, |
117 Compiler::ValidationState validate, | 117 Compiler::ValidationState validate, |
118 Handle<Script> script, | 118 Handle<Script> script, |
119 Handle<Context> context, | 119 Handle<Context> context, |
120 v8::Extension* extension, | 120 v8::Extension* extension, |
121 ScriptDataImpl* pre_data) { | 121 ScriptDataImpl* pre_data) { |
122 CompilationZoneScope zone_scope(DELETE_ON_EXIT); | 122 CompilationZoneScope zone_scope(DELETE_ON_EXIT); |
123 | 123 |
124 // Make sure we have an initial stack limit. | |
125 StackGuard guard; | |
126 PostponeInterruptsScope postpone; | 124 PostponeInterruptsScope postpone; |
127 | 125 |
128 ASSERT(!i::Top::global_context().is_null()); | 126 ASSERT(!i::Top::global_context().is_null()); |
129 script->set_context_data((*i::Top::global_context())->data()); | 127 script->set_context_data((*i::Top::global_context())->data()); |
130 | 128 |
131 #ifdef ENABLE_DEBUGGER_SUPPORT | 129 #ifdef ENABLE_DEBUGGER_SUPPORT |
132 bool is_json = (validate == Compiler::VALIDATE_JSON); | 130 bool is_json = (validate == Compiler::VALIDATE_JSON); |
133 if (is_eval || is_json) { | 131 if (is_eval || is_json) { |
134 script->set_compilation_type( | 132 script->set_compilation_type( |
135 is_json ? Smi::FromInt(Script::COMPILATION_TYPE_JSON) : | 133 is_json ? Smi::FromInt(Script::COMPILATION_TYPE_JSON) : |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 342 } |
345 | 343 |
346 | 344 |
347 bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared, | 345 bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared, |
348 int loop_nesting) { | 346 int loop_nesting) { |
349 CompilationZoneScope zone_scope(DELETE_ON_EXIT); | 347 CompilationZoneScope zone_scope(DELETE_ON_EXIT); |
350 | 348 |
351 // The VM is in the COMPILER state until exiting this function. | 349 // The VM is in the COMPILER state until exiting this function. |
352 VMState state(COMPILER); | 350 VMState state(COMPILER); |
353 | 351 |
354 // Make sure we have an initial stack limit. | |
355 StackGuard guard; | |
356 PostponeInterruptsScope postpone; | 352 PostponeInterruptsScope postpone; |
357 | 353 |
358 // Compute name, source code and script data. | 354 // Compute name, source code and script data. |
359 Handle<String> name(String::cast(shared->name())); | 355 Handle<String> name(String::cast(shared->name())); |
360 Handle<Script> script(Script::cast(shared->script())); | 356 Handle<Script> script(Script::cast(shared->script())); |
361 | 357 |
362 int start_position = shared->start_position(); | 358 int start_position = shared->start_position(); |
363 int end_position = shared->end_position(); | 359 int end_position = shared->end_position(); |
364 bool is_expression = shared->is_expression(); | 360 bool is_expression = shared->is_expression(); |
365 Counters::total_compile_size.Increment(end_position - start_position); | 361 Counters::total_compile_size.Increment(end_position - start_position); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 lit->has_only_simple_this_property_assignments(), | 428 lit->has_only_simple_this_property_assignments(), |
433 *lit->this_property_assignments()); | 429 *lit->this_property_assignments()); |
434 | 430 |
435 // Check the function has compiled code. | 431 // Check the function has compiled code. |
436 ASSERT(shared->is_compiled()); | 432 ASSERT(shared->is_compiled()); |
437 return true; | 433 return true; |
438 } | 434 } |
439 | 435 |
440 | 436 |
441 } } // namespace v8::internal | 437 } } // namespace v8::internal |
OLD | NEW |