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

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: fix async function constructor Created 4 years, 1 month 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/objects.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 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2187 if (!source->resource_name.IsEmpty()) { 2187 if (!source->resource_name.IsEmpty()) {
2188 name_obj = Utils::OpenHandle(*(source->resource_name)); 2188 name_obj = Utils::OpenHandle(*(source->resource_name));
2189 } 2189 }
2190 if (!source->resource_line_offset.IsEmpty()) { 2190 if (!source->resource_line_offset.IsEmpty()) {
2191 line_offset = static_cast<int>(source->resource_line_offset->Value()); 2191 line_offset = static_cast<int>(source->resource_line_offset->Value());
2192 } 2192 }
2193 if (!source->resource_column_offset.IsEmpty()) { 2193 if (!source->resource_column_offset.IsEmpty()) {
2194 column_offset = static_cast<int>(source->resource_column_offset->Value()); 2194 column_offset = static_cast<int>(source->resource_column_offset->Value());
2195 } 2195 }
2196 i::Handle<i::JSFunction> fun; 2196 i::Handle<i::JSFunction> fun;
2197 // TODO(jwolfe): restrict parameters_end_pos?
2197 has_pending_exception = 2198 has_pending_exception =
2198 !i::Compiler::GetFunctionFromEval( 2199 !i::Compiler::GetFunctionFromEval(
2199 source_string, outer_info, context, i::SLOPPY, 2200 source_string, outer_info, context, i::SLOPPY,
2200 i::ONLY_SINGLE_FUNCTION_LITERAL, eval_scope_position, eval_position, 2201 i::ONLY_SINGLE_FUNCTION_LITERAL, i::kNoSourcePosition,
2201 line_offset, column_offset - scope_position, name_obj, 2202 eval_scope_position, eval_position, line_offset,
2202 source->resource_options) 2203 column_offset - scope_position, name_obj, source->resource_options)
2203 .ToHandle(&fun); 2204 .ToHandle(&fun);
2204 if (has_pending_exception) { 2205 if (has_pending_exception) {
2205 isolate->ReportPendingMessages(); 2206 isolate->ReportPendingMessages();
2206 } 2207 }
2207 RETURN_ON_FAILED_EXECUTION(Function); 2208 RETURN_ON_FAILED_EXECUTION(Function);
2208 2209
2209 i::Handle<i::Object> result; 2210 i::Handle<i::Object> result;
2210 has_pending_exception = 2211 has_pending_exception =
2211 !i::Execution::Call(isolate, fun, 2212 !i::Execution::Call(isolate, fun,
2212 Utils::OpenHandle(*v8_context->Global()), 0, 2213 Utils::OpenHandle(*v8_context->Global()), 0,
(...skipping 7287 matching lines...) Expand 10 before | Expand all | Expand 10 after
9500 Address callback_address = 9501 Address callback_address =
9501 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9502 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9502 VMState<EXTERNAL> state(isolate); 9503 VMState<EXTERNAL> state(isolate);
9503 ExternalCallbackScope call_scope(isolate, callback_address); 9504 ExternalCallbackScope call_scope(isolate, callback_address);
9504 callback(info); 9505 callback(info);
9505 } 9506 }
9506 9507
9507 9508
9508 } // namespace internal 9509 } // namespace internal
9509 } // namespace v8 9510 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698