| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/builtins.h" | 5 #include "src/builtins.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
| 9 #include "src/api-natives.h" | 9 #include "src/api-natives.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2048 if (native_context->allow_code_gen_from_strings()->IsFalse() && | 2048 if (native_context->allow_code_gen_from_strings()->IsFalse() && |
| 2049 !CodeGenerationFromStringsAllowed(isolate, native_context)) { | 2049 !CodeGenerationFromStringsAllowed(isolate, native_context)) { |
| 2050 Handle<Object> error_message = | 2050 Handle<Object> error_message = |
| 2051 native_context->ErrorMessageForCodeGenerationFromStrings(); | 2051 native_context->ErrorMessageForCodeGenerationFromStrings(); |
| 2052 THROW_NEW_ERROR(isolate, NewEvalError(MessageTemplate::kCodeGenFromStrings, | 2052 THROW_NEW_ERROR(isolate, NewEvalError(MessageTemplate::kCodeGenFromStrings, |
| 2053 error_message), | 2053 error_message), |
| 2054 JSFunction); | 2054 JSFunction); |
| 2055 } | 2055 } |
| 2056 | 2056 |
| 2057 // Compile source string in the native context. | 2057 // Compile source string in the native context. |
| 2058 StackTraceFrameIterator it(isolate); | 2058 Handle<SharedFunctionInfo> outer_info(native_context->closure()->shared(), |
| 2059 FrameSummary summary = FrameSummary::GetFirst(it.frame()); | 2059 isolate); |
| 2060 Handle<SharedFunctionInfo> outer_info(summary.function()->shared()); | |
| 2061 int pos = summary.abstract_code()->SourcePosition(summary.code_offset()); | |
| 2062 return Compiler::GetFunctionFromEval(source, outer_info, native_context, | 2060 return Compiler::GetFunctionFromEval(source, outer_info, native_context, |
| 2063 SLOPPY, restriction, pos); | 2061 SLOPPY, restriction, |
| 2062 RelocInfo::kNoPosition); |
| 2064 } | 2063 } |
| 2065 | 2064 |
| 2066 } // namespace | 2065 } // namespace |
| 2067 | 2066 |
| 2068 | 2067 |
| 2069 // ES6 section 18.2.1 eval (x) | 2068 // ES6 section 18.2.1 eval (x) |
| 2070 BUILTIN(GlobalEval) { | 2069 BUILTIN(GlobalEval) { |
| 2071 HandleScope scope(isolate); | 2070 HandleScope scope(isolate); |
| 2072 Handle<Object> x = args.atOrUndefined(isolate, 1); | 2071 Handle<Object> x = args.atOrUndefined(isolate, 1); |
| 2073 Handle<JSFunction> target = args.target<JSFunction>(); | 2072 Handle<JSFunction> target = args.target<JSFunction>(); |
| (...skipping 2768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4842 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) | 4841 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) |
| 4843 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 4842 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 4844 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 4843 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 4845 #undef DEFINE_BUILTIN_ACCESSOR_C | 4844 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 4846 #undef DEFINE_BUILTIN_ACCESSOR_A | 4845 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 4847 #undef DEFINE_BUILTIN_ACCESSOR_T | 4846 #undef DEFINE_BUILTIN_ACCESSOR_T |
| 4848 #undef DEFINE_BUILTIN_ACCESSOR_H | 4847 #undef DEFINE_BUILTIN_ACCESSOR_H |
| 4849 | 4848 |
| 4850 } // namespace internal | 4849 } // namespace internal |
| 4851 } // namespace v8 | 4850 } // namespace v8 |
| OLD | NEW |