| Index: src/builtins/builtins.cc
|
| diff --git a/src/builtins/builtins.cc b/src/builtins/builtins.cc
|
| index f8af743e0bc2ff0a33eb5a5a6542bfa9e22f7c26..376be283015e13ea7f9b8c9d01fcba18fd3a416a 100644
|
| --- a/src/builtins/builtins.cc
|
| +++ b/src/builtins/builtins.cc
|
| @@ -271,52 +271,6 @@ BUILTIN(HandleApiCall) {
|
| }
|
| }
|
|
|
| -namespace {
|
| -
|
| -bool CodeGenerationFromStringsAllowed(Isolate* isolate,
|
| - Handle<Context> context) {
|
| - DCHECK(context->allow_code_gen_from_strings()->IsFalse(isolate));
|
| - // Check with callback if set.
|
| - AllowCodeGenerationFromStringsCallback callback =
|
| - isolate->allow_code_gen_callback();
|
| - if (callback == NULL) {
|
| - // No callback set and code generation disallowed.
|
| - return false;
|
| - } else {
|
| - // Callback set. Let it decide if code generation is allowed.
|
| - VMState<EXTERNAL> state(isolate);
|
| - return callback(v8::Utils::ToLocal(context));
|
| - }
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| -MaybeHandle<JSFunction> Builtins::CompileString(Handle<Context> context,
|
| - Handle<String> source,
|
| - ParseRestriction restriction) {
|
| - Isolate* const isolate = context->GetIsolate();
|
| - Handle<Context> native_context(context->native_context(), isolate);
|
| -
|
| - // Check if native context allows code generation from
|
| - // strings. Throw an exception if it doesn't.
|
| - if (native_context->allow_code_gen_from_strings()->IsFalse(isolate) &&
|
| - !CodeGenerationFromStringsAllowed(isolate, native_context)) {
|
| - Handle<Object> error_message =
|
| - native_context->ErrorMessageForCodeGenerationFromStrings();
|
| - THROW_NEW_ERROR(isolate, NewEvalError(MessageTemplate::kCodeGenFromStrings,
|
| - error_message),
|
| - JSFunction);
|
| - }
|
| -
|
| - // Compile source string in the native context.
|
| - int eval_scope_position = 0;
|
| - int eval_position = kNoSourcePosition;
|
| - Handle<SharedFunctionInfo> outer_info(native_context->closure()->shared());
|
| - return Compiler::GetFunctionFromEval(source, outer_info, native_context,
|
| - SLOPPY, restriction, eval_scope_position,
|
| - eval_position);
|
| -}
|
| -
|
| Handle<Code> Builtins::CallFunction(ConvertReceiverMode mode,
|
| TailCallMode tail_call_mode) {
|
| switch (tail_call_mode) {
|
|
|