OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 7903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7914 kNonStrictMode); | 7914 kNonStrictMode); |
7915 if (shared.is_null()) return Failure::Exception(); | 7915 if (shared.is_null()) return Failure::Exception(); |
7916 Handle<JSFunction> fun = | 7916 Handle<JSFunction> fun = |
7917 Factory::NewFunctionFromSharedFunctionInfo(shared, context, NOT_TENURED); | 7917 Factory::NewFunctionFromSharedFunctionInfo(shared, context, NOT_TENURED); |
7918 return *fun; | 7918 return *fun; |
7919 } | 7919 } |
7920 | 7920 |
7921 | 7921 |
7922 static ObjectPair CompileGlobalEval(Handle<String> source, | 7922 static ObjectPair CompileGlobalEval(Handle<String> source, |
7923 Handle<Object> receiver, | 7923 Handle<Object> receiver, |
7924 StrictModeFlag mode) { | 7924 StrictModeFlag strict_mode) { |
7925 // Deal with a normal eval call with a string argument. Compile it | 7925 // Deal with a normal eval call with a string argument. Compile it |
7926 // and return the compiled function bound in the local context. | 7926 // and return the compiled function bound in the local context. |
7927 Handle<SharedFunctionInfo> shared = Compiler::CompileEval( | 7927 Handle<SharedFunctionInfo> shared = Compiler::CompileEval( |
7928 source, | 7928 source, |
7929 Handle<Context>(Top::context()), | 7929 Handle<Context>(Top::context()), |
7930 Top::context()->IsGlobalContext(), | 7930 Top::context()->IsGlobalContext(), |
7931 mode); | 7931 strict_mode); |
7932 if (shared.is_null()) return MakePair(Failure::Exception(), NULL); | 7932 if (shared.is_null()) return MakePair(Failure::Exception(), NULL); |
7933 Handle<JSFunction> compiled = Factory::NewFunctionFromSharedFunctionInfo( | 7933 Handle<JSFunction> compiled = Factory::NewFunctionFromSharedFunctionInfo( |
7934 shared, | 7934 shared, |
7935 Handle<Context>(Top::context()), | 7935 Handle<Context>(Top::context()), |
7936 NOT_TENURED); | 7936 NOT_TENURED); |
7937 return MakePair(*compiled, *receiver); | 7937 return MakePair(*compiled, *receiver); |
7938 } | 7938 } |
7939 | 7939 |
7940 | 7940 |
7941 static ObjectPair Runtime_ResolvePossiblyDirectEval(Arguments args) { | 7941 static ObjectPair Runtime_ResolvePossiblyDirectEval(Arguments args) { |
(...skipping 3686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11628 } else { | 11628 } else { |
11629 // Handle last resort GC and make sure to allow future allocations | 11629 // Handle last resort GC and make sure to allow future allocations |
11630 // to grow the heap without causing GCs (if possible). | 11630 // to grow the heap without causing GCs (if possible). |
11631 Counters::gc_last_resort_from_js.Increment(); | 11631 Counters::gc_last_resort_from_js.Increment(); |
11632 Heap::CollectAllGarbage(false); | 11632 Heap::CollectAllGarbage(false); |
11633 } | 11633 } |
11634 } | 11634 } |
11635 | 11635 |
11636 | 11636 |
11637 } } // namespace v8::internal | 11637 } } // namespace v8::internal |
OLD | NEW |