OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 9065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9076 LanguageMode language_mode, | 9076 LanguageMode language_mode, |
9077 int scope_position) { | 9077 int scope_position) { |
9078 Handle<Context> context = Handle<Context>(isolate->context()); | 9078 Handle<Context> context = Handle<Context>(isolate->context()); |
9079 Handle<Context> native_context = Handle<Context>(context->native_context()); | 9079 Handle<Context> native_context = Handle<Context>(context->native_context()); |
9080 | 9080 |
9081 // Check if native context allows code generation from | 9081 // Check if native context allows code generation from |
9082 // strings. Throw an exception if it doesn't. | 9082 // strings. Throw an exception if it doesn't. |
9083 if (native_context->allow_code_gen_from_strings()->IsFalse() && | 9083 if (native_context->allow_code_gen_from_strings()->IsFalse() && |
9084 !CodeGenerationFromStringsAllowed(isolate, native_context)) { | 9084 !CodeGenerationFromStringsAllowed(isolate, native_context)) { |
9085 Handle<Object> error_message = | 9085 Handle<Object> error_message = |
9086 context->ErrorMessageForCodeGenerationFromStrings(); | 9086 native_context->ErrorMessageForCodeGenerationFromStrings(); |
9087 isolate->Throw(*isolate->factory()->NewEvalError( | 9087 isolate->Throw(*isolate->factory()->NewEvalError( |
9088 "code_gen_from_strings", HandleVector<Object>(&error_message, 1))); | 9088 "code_gen_from_strings", HandleVector<Object>(&error_message, 1))); |
9089 return MakePair(Failure::Exception(), NULL); | 9089 return MakePair(Failure::Exception(), NULL); |
9090 } | 9090 } |
9091 | 9091 |
9092 // Deal with a normal eval call with a string argument. Compile it | 9092 // Deal with a normal eval call with a string argument. Compile it |
9093 // and return the compiled function bound in the local context. | 9093 // and return the compiled function bound in the local context. |
9094 Handle<SharedFunctionInfo> shared = Compiler::CompileEval( | 9094 Handle<SharedFunctionInfo> shared = Compiler::CompileEval( |
9095 source, | 9095 source, |
9096 Handle<Context>(isolate->context()), | 9096 Handle<Context>(isolate->context()), |
(...skipping 4182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13279 // Handle last resort GC and make sure to allow future allocations | 13279 // Handle last resort GC and make sure to allow future allocations |
13280 // to grow the heap without causing GCs (if possible). | 13280 // to grow the heap without causing GCs (if possible). |
13281 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13281 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13282 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13282 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13283 "Runtime::PerformGC"); | 13283 "Runtime::PerformGC"); |
13284 } | 13284 } |
13285 } | 13285 } |
13286 | 13286 |
13287 | 13287 |
13288 } } // namespace v8::internal | 13288 } } // namespace v8::internal |
OLD | NEW |