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

Side by Side Diff: src/api.cc

Issue 2156303002: Implement new Function.prototype.toString and fix CreateDynamicFunction parsing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years 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 | « no previous file | src/bootstrapper.cc » ('j') | src/compiler.cc » ('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 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after
2255 if (!source->resource_name.IsEmpty()) { 2255 if (!source->resource_name.IsEmpty()) {
2256 name_obj = Utils::OpenHandle(*(source->resource_name)); 2256 name_obj = Utils::OpenHandle(*(source->resource_name));
2257 } 2257 }
2258 if (!source->resource_line_offset.IsEmpty()) { 2258 if (!source->resource_line_offset.IsEmpty()) {
2259 line_offset = static_cast<int>(source->resource_line_offset->Value()); 2259 line_offset = static_cast<int>(source->resource_line_offset->Value());
2260 } 2260 }
2261 if (!source->resource_column_offset.IsEmpty()) { 2261 if (!source->resource_column_offset.IsEmpty()) {
2262 column_offset = static_cast<int>(source->resource_column_offset->Value()); 2262 column_offset = static_cast<int>(source->resource_column_offset->Value());
2263 } 2263 }
2264 i::Handle<i::JSFunction> fun; 2264 i::Handle<i::JSFunction> fun;
2265 // TODO(jwolfe): restrict parameters_end_pos?
Dan Ehrenberg 2016/12/06 00:32:13 Could you elaborate a bit more in this TODO? Why w
jwolfe 2017/01/13 00:28:47 I just did it, and it seems like the right thing t
2265 has_pending_exception = 2266 has_pending_exception =
2266 !i::Compiler::GetFunctionFromEval( 2267 !i::Compiler::GetFunctionFromEval(
2267 source_string, outer_info, context, i::SLOPPY, 2268 source_string, outer_info, context, i::SLOPPY,
2268 i::ONLY_SINGLE_FUNCTION_LITERAL, eval_scope_position, eval_position, 2269 i::ONLY_SINGLE_FUNCTION_LITERAL, i::kNoSourcePosition,
2269 line_offset, column_offset - scope_position, name_obj, 2270 eval_scope_position, eval_position, line_offset,
2270 source->resource_options) 2271 column_offset - scope_position, name_obj, source->resource_options)
2271 .ToHandle(&fun); 2272 .ToHandle(&fun);
2272 if (has_pending_exception) { 2273 if (has_pending_exception) {
2273 isolate->ReportPendingMessages(); 2274 isolate->ReportPendingMessages();
2274 } 2275 }
2275 RETURN_ON_FAILED_EXECUTION(Function); 2276 RETURN_ON_FAILED_EXECUTION(Function);
2276 2277
2277 i::Handle<i::Object> result; 2278 i::Handle<i::Object> result;
2278 has_pending_exception = 2279 has_pending_exception =
2279 !i::Execution::Call(isolate, fun, 2280 !i::Execution::Call(isolate, fun,
2280 Utils::OpenHandle(*v8_context->Global()), 0, 2281 Utils::OpenHandle(*v8_context->Global()), 0,
(...skipping 7583 matching lines...) Expand 10 before | Expand all | Expand 10 after
9864 Address callback_address = 9865 Address callback_address =
9865 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9866 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9866 VMState<EXTERNAL> state(isolate); 9867 VMState<EXTERNAL> state(isolate);
9867 ExternalCallbackScope call_scope(isolate, callback_address); 9868 ExternalCallbackScope call_scope(isolate, callback_address);
9868 callback(info); 9869 callback(info);
9869 } 9870 }
9870 9871
9871 9872
9872 } // namespace internal 9873 } // namespace internal
9873 } // namespace v8 9874 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698