| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 Handle<SerializedScopeInfo> scope_info = | 330 Handle<SerializedScopeInfo> scope_info = |
| 331 SerializedScopeInfo::Create(info->scope()); | 331 SerializedScopeInfo::Create(info->scope()); |
| 332 info->shared_info()->set_scope_info(*scope_info); | 332 info->shared_info()->set_scope_info(*scope_info); |
| 333 } | 333 } |
| 334 return succeeded; | 334 return succeeded; |
| 335 } | 335 } |
| 336 #endif | 336 #endif |
| 337 | 337 |
| 338 | 338 |
| 339 static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) { | 339 static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) { |
| 340 CompilationZoneScope zone_scope(DELETE_ON_EXIT); | |
| 341 | |
| 342 Isolate* isolate = info->isolate(); | 340 Isolate* isolate = info->isolate(); |
| 341 CompilationZoneScope zone_scope(isolate, DELETE_ON_EXIT); |
| 343 PostponeInterruptsScope postpone(isolate); | 342 PostponeInterruptsScope postpone(isolate); |
| 344 | 343 |
| 345 ASSERT(!isolate->global_context().is_null()); | 344 ASSERT(!isolate->global_context().is_null()); |
| 346 Handle<Script> script = info->script(); | 345 Handle<Script> script = info->script(); |
| 347 script->set_context_data((*isolate->global_context())->data()); | 346 script->set_context_data((*isolate->global_context())->data()); |
| 348 | 347 |
| 349 #ifdef ENABLE_DEBUGGER_SUPPORT | 348 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 350 if (info->is_eval()) { | 349 if (info->is_eval()) { |
| 351 Script::CompilationType compilation_type = Script::COMPILATION_TYPE_EVAL; | 350 Script::CompilationType compilation_type = Script::COMPILATION_TYPE_EVAL; |
| 352 script->set_compilation_type(Smi::FromInt(compilation_type)); | 351 script->set_compilation_type(Smi::FromInt(compilation_type)); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 ASSERT(strict_mode == kNonStrictMode || result->strict_mode()); | 563 ASSERT(strict_mode == kNonStrictMode || result->strict_mode()); |
| 565 compilation_cache->PutEval(source, context, is_global, result); | 564 compilation_cache->PutEval(source, context, is_global, result); |
| 566 } | 565 } |
| 567 } | 566 } |
| 568 | 567 |
| 569 return result; | 568 return result; |
| 570 } | 569 } |
| 571 | 570 |
| 572 | 571 |
| 573 bool Compiler::CompileLazy(CompilationInfo* info) { | 572 bool Compiler::CompileLazy(CompilationInfo* info) { |
| 574 CompilationZoneScope zone_scope(DELETE_ON_EXIT); | 573 Isolate* isolate = info->isolate(); |
| 574 |
| 575 CompilationZoneScope zone_scope(isolate, DELETE_ON_EXIT); |
| 575 | 576 |
| 576 // The VM is in the COMPILER state until exiting this function. | 577 // The VM is in the COMPILER state until exiting this function. |
| 577 VMState state(info->isolate(), COMPILER); | 578 VMState state(isolate, COMPILER); |
| 578 | 579 |
| 579 Isolate* isolate = info->isolate(); | |
| 580 PostponeInterruptsScope postpone(isolate); | 580 PostponeInterruptsScope postpone(isolate); |
| 581 | 581 |
| 582 Handle<SharedFunctionInfo> shared = info->shared_info(); | 582 Handle<SharedFunctionInfo> shared = info->shared_info(); |
| 583 int compiled_size = shared->end_position() - shared->start_position(); | 583 int compiled_size = shared->end_position() - shared->start_position(); |
| 584 isolate->counters()->total_compile_size()->Increment(compiled_size); | 584 isolate->counters()->total_compile_size()->Increment(compiled_size); |
| 585 | 585 |
| 586 // Generate the AST for the lazily compiled function. | 586 // Generate the AST for the lazily compiled function. |
| 587 if (ParserApi::Parse(info)) { | 587 if (ParserApi::Parse(info)) { |
| 588 // Measure how long it takes to do the lazy compilation; only take the | 588 // Measure how long it takes to do the lazy compilation; only take the |
| 589 // rest of the function into account to avoid overlap with the lazy | 589 // rest of the function into account to avoid overlap with the lazy |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 shared->DebugName())); | 776 shared->DebugName())); |
| 777 } | 777 } |
| 778 } | 778 } |
| 779 | 779 |
| 780 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 780 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 781 Handle<Script>(info->script()), | 781 Handle<Script>(info->script()), |
| 782 Handle<Code>(info->code()))); | 782 Handle<Code>(info->code()))); |
| 783 } | 783 } |
| 784 | 784 |
| 785 } } // namespace v8::internal | 785 } } // namespace v8::internal |
| OLD | NEW |