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

Side by Side Diff: src/api.cc

Issue 2002933002: [json] move json parser and stringifier into own compilation units. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 7 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 | « BUILD.gn ('k') | src/json-parser.h » ('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 22 matching lines...) Expand all
33 #include "src/conversions-inl.h" 33 #include "src/conversions-inl.h"
34 #include "src/counters.h" 34 #include "src/counters.h"
35 #include "src/debug/debug.h" 35 #include "src/debug/debug.h"
36 #include "src/deoptimizer.h" 36 #include "src/deoptimizer.h"
37 #include "src/execution.h" 37 #include "src/execution.h"
38 #include "src/gdb-jit.h" 38 #include "src/gdb-jit.h"
39 #include "src/global-handles.h" 39 #include "src/global-handles.h"
40 #include "src/icu_util.h" 40 #include "src/icu_util.h"
41 #include "src/isolate-inl.h" 41 #include "src/isolate-inl.h"
42 #include "src/json-parser.h" 42 #include "src/json-parser.h"
43 #include "src/json-stringifier.h"
43 #include "src/messages.h" 44 #include "src/messages.h"
44 #include "src/parsing/parser.h" 45 #include "src/parsing/parser.h"
45 #include "src/parsing/scanner-character-streams.h" 46 #include "src/parsing/scanner-character-streams.h"
46 #include "src/pending-compilation-error-handler.h" 47 #include "src/pending-compilation-error-handler.h"
47 #include "src/profiler/cpu-profiler.h" 48 #include "src/profiler/cpu-profiler.h"
48 #include "src/profiler/heap-profiler.h" 49 #include "src/profiler/heap-profiler.h"
49 #include "src/profiler/heap-snapshot-generator-inl.h" 50 #include "src/profiler/heap-snapshot-generator-inl.h"
50 #include "src/profiler/profile-generator-inl.h" 51 #include "src/profiler/profile-generator-inl.h"
51 #include "src/profiler/tick-sample.h" 52 #include "src/profiler/tick-sample.h"
52 #include "src/property-descriptor.h" 53 #include "src/property-descriptor.h"
(...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after
2770 2771
2771 MaybeLocal<String> JSON::Stringify(Local<Context> context, 2772 MaybeLocal<String> JSON::Stringify(Local<Context> context,
2772 Local<Object> json_object, 2773 Local<Object> json_object,
2773 Local<String> gap) { 2774 Local<String> gap) {
2774 PREPARE_FOR_EXECUTION(context, JSON, Stringify, String); 2775 PREPARE_FOR_EXECUTION(context, JSON, Stringify, String);
2775 i::Handle<i::Object> object = Utils::OpenHandle(*json_object); 2776 i::Handle<i::Object> object = Utils::OpenHandle(*json_object);
2776 i::Handle<i::String> gap_string = gap.IsEmpty() 2777 i::Handle<i::String> gap_string = gap.IsEmpty()
2777 ? isolate->factory()->empty_string() 2778 ? isolate->factory()->empty_string()
2778 : Utils::OpenHandle(*gap); 2779 : Utils::OpenHandle(*gap);
2779 i::Handle<i::Object> maybe; 2780 i::Handle<i::Object> maybe;
2780 has_pending_exception = 2781 has_pending_exception = !i::BasicJsonStringifier(isolate, gap_string)
2781 !i::Runtime::BasicJsonStringify(isolate, object, gap_string) 2782 .Stringify(object)
2782 .ToHandle(&maybe); 2783 .ToHandle(&maybe);
2783 RETURN_ON_FAILED_EXECUTION(String); 2784 RETURN_ON_FAILED_EXECUTION(String);
2784 Local<String> result; 2785 Local<String> result;
2785 has_pending_exception = 2786 has_pending_exception =
2786 !ToLocal<String>(i::Object::ToString(isolate, maybe), &result); 2787 !ToLocal<String>(i::Object::ToString(isolate, maybe), &result);
2787 RETURN_ON_FAILED_EXECUTION(String); 2788 RETURN_ON_FAILED_EXECUTION(String);
2788 RETURN_ESCAPED(result); 2789 RETURN_ESCAPED(result);
2789 } 2790 }
2790 2791
2791 // --- D a t a --- 2792 // --- D a t a ---
2792 2793
(...skipping 6015 matching lines...) Expand 10 before | Expand all | Expand 10 after
8808 Address callback_address = 8809 Address callback_address =
8809 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8810 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8810 VMState<EXTERNAL> state(isolate); 8811 VMState<EXTERNAL> state(isolate);
8811 ExternalCallbackScope call_scope(isolate, callback_address); 8812 ExternalCallbackScope call_scope(isolate, callback_address);
8812 callback(info); 8813 callback(info);
8813 } 8814 }
8814 8815
8815 8816
8816 } // namespace internal 8817 } // namespace internal
8817 } // namespace v8 8818 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/json-parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698