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

Side by Side Diff: src/api.cc

Issue 2789223002: [api] Fix harmony formatting for CompileFunctionInContext
Patch Set: Created 3 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 | « no previous file | test/cctest/test-compiler.cc » ('j') | no next file with comments »
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 2280 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 has_pending_exception = 2291 has_pending_exception =
2292 !factory->NewConsString(source_string, 2292 !factory->NewConsString(source_string,
2293 factory->LookupSingleCharacterStringFromCode( 2293 factory->LookupSingleCharacterStringFromCode(
2294 ',')).ToHandle(&source_string); 2294 ',')).ToHandle(&source_string);
2295 RETURN_ON_FAILED_EXECUTION(Function); 2295 RETURN_ON_FAILED_EXECUTION(Function);
2296 } 2296 }
2297 i::Handle<i::String> brackets; 2297 i::Handle<i::String> brackets;
2298 if (i::FLAG_harmony_function_tostring) { 2298 if (i::FLAG_harmony_function_tostring) {
2299 // Append linefeed and signal that text beyond the linefeed is not part of 2299 // Append linefeed and signal that text beyond the linefeed is not part of
2300 // the formal parameters. 2300 // the formal parameters.
2301 brackets = factory->NewStringFromStaticChars("\n) {"); 2301 brackets = factory->NewStringFromStaticChars("\n) {\n");
2302 parameters_end_pos = source_string->length() + 1; 2302 parameters_end_pos = source_string->length() + 1;
2303 } else { 2303 } else {
2304 brackets = factory->NewStringFromStaticChars("){"); 2304 brackets = factory->NewStringFromStaticChars("){");
2305 } 2305 }
2306 has_pending_exception = !factory->NewConsString(source_string, brackets) 2306 has_pending_exception = !factory->NewConsString(source_string, brackets)
2307 .ToHandle(&source_string); 2307 .ToHandle(&source_string);
2308 RETURN_ON_FAILED_EXECUTION(Function); 2308 RETURN_ON_FAILED_EXECUTION(Function);
2309 } else { 2309 } else {
2310 if (i::FLAG_harmony_function_tostring) { 2310 if (i::FLAG_harmony_function_tostring) {
2311 source_string = 2311 source_string =
2312 factory->NewStringFromStaticChars("(function anonymous(\n) {"); 2312 factory->NewStringFromStaticChars("(function anonymous(\n) {\n");
2313 parameters_end_pos = source_string->length() - 3; 2313 parameters_end_pos = source_string->length() - 4;
2314 } else { 2314 } else {
2315 source_string = factory->NewStringFromStaticChars("(function(){"); 2315 source_string = factory->NewStringFromStaticChars("(function(){");
2316 } 2316 }
2317 } 2317 }
2318 2318
2319 int scope_position = source_string->length(); 2319 int scope_position = source_string->length();
2320 has_pending_exception = 2320 has_pending_exception =
2321 !factory->NewConsString(source_string, 2321 !factory->NewConsString(source_string,
2322 Utils::OpenHandle(*source->source_string)) 2322 Utils::OpenHandle(*source->source_string))
2323 .ToHandle(&source_string); 2323 .ToHandle(&source_string);
(...skipping 8000 matching lines...) Expand 10 before | Expand all | Expand 10 after
10324 Address callback_address = 10324 Address callback_address =
10325 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10325 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10326 VMState<EXTERNAL> state(isolate); 10326 VMState<EXTERNAL> state(isolate);
10327 ExternalCallbackScope call_scope(isolate, callback_address); 10327 ExternalCallbackScope call_scope(isolate, callback_address);
10328 callback(info); 10328 callback(info);
10329 } 10329 }
10330 10330
10331 10331
10332 } // namespace internal 10332 } // namespace internal
10333 } // namespace v8 10333 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698