| 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 11200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11211 StackSlotIndex(isolate_->heap()->result_symbol()); | 11211 StackSlotIndex(isolate_->heap()->result_symbol()); |
| 11212 | 11212 |
| 11213 // Reparse the code and analyze the scopes. | 11213 // Reparse the code and analyze the scopes. |
| 11214 ZoneScope zone_scope(isolate, DELETE_ON_EXIT); | 11214 ZoneScope zone_scope(isolate, DELETE_ON_EXIT); |
| 11215 Handle<Script> script(Script::cast(shared_info->script())); | 11215 Handle<Script> script(Script::cast(shared_info->script())); |
| 11216 Scope* scope; | 11216 Scope* scope; |
| 11217 if (index >= 0) { | 11217 if (index >= 0) { |
| 11218 // Global code | 11218 // Global code |
| 11219 CompilationInfo info(script); | 11219 CompilationInfo info(script); |
| 11220 info.MarkAsGlobal(); | 11220 info.MarkAsGlobal(); |
| 11221 bool result = ParserApi::Parse(&info); | 11221 CHECK(ParserApi::Parse(&info)); |
| 11222 ASSERT(result); | 11222 CHECK(Scope::Analyze(&info)); |
| 11223 result = Scope::Analyze(&info); | |
| 11224 ASSERT(result); | |
| 11225 scope = info.function()->scope(); | 11223 scope = info.function()->scope(); |
| 11226 } else { | 11224 } else { |
| 11227 // Function code | 11225 // Function code |
| 11228 CompilationInfo info(shared_info); | 11226 CompilationInfo info(shared_info); |
| 11229 bool result = ParserApi::Parse(&info); | 11227 CHECK(ParserApi::Parse(&info)); |
| 11230 ASSERT(result); | 11228 CHECK(Scope::Analyze(&info)); |
| 11231 result = Scope::Analyze(&info); | |
| 11232 ASSERT(result); | |
| 11233 scope = info.function()->scope(); | 11229 scope = info.function()->scope(); |
| 11234 } | 11230 } |
| 11235 | 11231 |
| 11236 // Retrieve the scope chain for the current position. | 11232 // Retrieve the scope chain for the current position. |
| 11237 int statement_position = | 11233 int statement_position = |
| 11238 shared_info->code()->SourceStatementPosition(frame_->pc()); | 11234 shared_info->code()->SourceStatementPosition(frame_->pc()); |
| 11239 scope->GetNestedScopeChain(&nested_scope_chain_, statement_position); | 11235 scope->GetNestedScopeChain(&nested_scope_chain_, statement_position); |
| 11240 } | 11236 } |
| 11241 | 11237 |
| 11242 // More scopes? | 11238 // More scopes? |
| (...skipping 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13518 } else { | 13514 } else { |
| 13519 // Handle last resort GC and make sure to allow future allocations | 13515 // Handle last resort GC and make sure to allow future allocations |
| 13520 // to grow the heap without causing GCs (if possible). | 13516 // to grow the heap without causing GCs (if possible). |
| 13521 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13517 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13522 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 13518 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); |
| 13523 } | 13519 } |
| 13524 } | 13520 } |
| 13525 | 13521 |
| 13526 | 13522 |
| 13527 } } // namespace v8::internal | 13523 } } // namespace v8::internal |
| OLD | NEW |