Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: src/api.cc

Issue 1854713002: Correctly annotate eval origin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix mips64 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/accessors.cc ('k') | src/builtins.cc » ('j') | src/frames.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 isolate); 2025 isolate);
2026 for (size_t i = 0; i < context_extension_count; ++i) { 2026 for (size_t i = 0; i < context_extension_count; ++i) {
2027 i::Handle<i::JSReceiver> extension = 2027 i::Handle<i::JSReceiver> extension =
2028 Utils::OpenHandle(*context_extensions[i]); 2028 Utils::OpenHandle(*context_extensions[i]);
2029 if (!extension->IsJSObject()) return Local<Function>(); 2029 if (!extension->IsJSObject()) return Local<Function>();
2030 i::Handle<i::JSFunction> closure(context->closure(), isolate); 2030 i::Handle<i::JSFunction> closure(context->closure(), isolate);
2031 context = factory->NewWithContext(closure, context, extension); 2031 context = factory->NewWithContext(closure, context, extension);
2032 } 2032 }
2033 2033
2034 i::Handle<i::Object> name_obj; 2034 i::Handle<i::Object> name_obj;
2035 int eval_position = 0;
2035 int line_offset = 0; 2036 int line_offset = 0;
2036 int column_offset = 0; 2037 int column_offset = 0;
2037 if (!source->resource_name.IsEmpty()) { 2038 if (!source->resource_name.IsEmpty()) {
2038 name_obj = Utils::OpenHandle(*(source->resource_name)); 2039 name_obj = Utils::OpenHandle(*(source->resource_name));
2039 } 2040 }
2040 if (!source->resource_line_offset.IsEmpty()) { 2041 if (!source->resource_line_offset.IsEmpty()) {
2041 line_offset = static_cast<int>(source->resource_line_offset->Value()); 2042 line_offset = static_cast<int>(source->resource_line_offset->Value());
2042 } 2043 }
2043 if (!source->resource_column_offset.IsEmpty()) { 2044 if (!source->resource_column_offset.IsEmpty()) {
2044 column_offset = static_cast<int>(source->resource_column_offset->Value()); 2045 column_offset = static_cast<int>(source->resource_column_offset->Value());
2045 } 2046 }
2046 i::Handle<i::JSFunction> fun; 2047 i::Handle<i::JSFunction> fun;
2047 has_pending_exception = !i::Compiler::GetFunctionFromEval( 2048 has_pending_exception =
2048 source_string, outer_info, context, i::SLOPPY, 2049 !i::Compiler::GetFunctionFromEval(
2049 i::ONLY_SINGLE_FUNCTION_LITERAL, line_offset, 2050 source_string, outer_info, context, i::SLOPPY,
2050 column_offset - scope_position, name_obj, 2051 i::ONLY_SINGLE_FUNCTION_LITERAL, eval_position, line_offset,
2051 source->resource_options).ToHandle(&fun); 2052 column_offset - scope_position, name_obj, source->resource_options)
2053 .ToHandle(&fun);
2052 if (has_pending_exception) { 2054 if (has_pending_exception) {
2053 isolate->ReportPendingMessages(); 2055 isolate->ReportPendingMessages();
2054 } 2056 }
2055 RETURN_ON_FAILED_EXECUTION(Function); 2057 RETURN_ON_FAILED_EXECUTION(Function);
2056 2058
2057 i::Handle<i::Object> result; 2059 i::Handle<i::Object> result;
2058 has_pending_exception = 2060 has_pending_exception =
2059 !i::Execution::Call(isolate, fun, 2061 !i::Execution::Call(isolate, fun,
2060 Utils::OpenHandle(*v8_context->Global()), 0, 2062 Utils::OpenHandle(*v8_context->Global()), 0,
2061 nullptr).ToHandle(&result); 2063 nullptr).ToHandle(&result);
(...skipping 6720 matching lines...) Expand 10 before | Expand all | Expand 10 after
8782 Address callback_address = 8784 Address callback_address =
8783 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8785 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8784 VMState<EXTERNAL> state(isolate); 8786 VMState<EXTERNAL> state(isolate);
8785 ExternalCallbackScope call_scope(isolate, callback_address); 8787 ExternalCallbackScope call_scope(isolate, callback_address);
8786 callback(info); 8788 callback(info);
8787 } 8789 }
8788 8790
8789 8791
8790 } // namespace internal 8792 } // namespace internal
8791 } // namespace v8 8793 } // namespace v8
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | src/builtins.cc » ('j') | src/frames.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698