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 10467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10478 static Handle<Context> CopyWithContextChain(Handle<Context> context_chain, | 10478 static Handle<Context> CopyWithContextChain(Handle<Context> context_chain, |
10479 Handle<Context> function_context) { | 10479 Handle<Context> function_context) { |
10480 // At the bottom of the chain. Return the function context to link to. | 10480 // At the bottom of the chain. Return the function context to link to. |
10481 if (context_chain->is_function_context()) { | 10481 if (context_chain->is_function_context()) { |
10482 return function_context; | 10482 return function_context; |
10483 } | 10483 } |
10484 | 10484 |
10485 // Recursively copy the with contexts. | 10485 // Recursively copy the with contexts. |
10486 Handle<Context> previous(context_chain->previous()); | 10486 Handle<Context> previous(context_chain->previous()); |
10487 Handle<JSObject> extension(JSObject::cast(context_chain->extension())); | 10487 Handle<JSObject> extension(JSObject::cast(context_chain->extension())); |
10488 Handle<Context> context = CopyWithContextChain(function_context, previous); | 10488 Handle<Context> context = CopyWithContextChain(previous, function_context); |
10489 return context->GetIsolate()->factory()->NewWithContext( | 10489 return context->GetIsolate()->factory()->NewWithContext( |
10490 context, extension, context_chain->IsCatchContext()); | 10490 context, extension, context_chain->IsCatchContext()); |
10491 } | 10491 } |
10492 | 10492 |
10493 | 10493 |
10494 // Helper function to find or create the arguments object for | 10494 // Helper function to find or create the arguments object for |
10495 // Runtime_DebugEvaluate. | 10495 // Runtime_DebugEvaluate. |
10496 static Handle<Object> GetArgumentsObject(Isolate* isolate, | 10496 static Handle<Object> GetArgumentsObject(Isolate* isolate, |
10497 JavaScriptFrame* frame, | 10497 JavaScriptFrame* frame, |
10498 Handle<JSFunction> function, | 10498 Handle<JSFunction> function, |
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11975 } else { | 11975 } else { |
11976 // Handle last resort GC and make sure to allow future allocations | 11976 // Handle last resort GC and make sure to allow future allocations |
11977 // to grow the heap without causing GCs (if possible). | 11977 // to grow the heap without causing GCs (if possible). |
11978 isolate->counters()->gc_last_resort_from_js()->Increment(); | 11978 isolate->counters()->gc_last_resort_from_js()->Increment(); |
11979 isolate->heap()->CollectAllGarbage(false); | 11979 isolate->heap()->CollectAllGarbage(false); |
11980 } | 11980 } |
11981 } | 11981 } |
11982 | 11982 |
11983 | 11983 |
11984 } } // namespace v8::internal | 11984 } } // namespace v8::internal |
OLD | NEW |