OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "cpu.h" | 39 #include "cpu.h" |
40 #include "dateparser-inl.h" | 40 #include "dateparser-inl.h" |
41 #include "debug.h" | 41 #include "debug.h" |
42 #include "deoptimizer.h" | 42 #include "deoptimizer.h" |
43 #include "date.h" | 43 #include "date.h" |
44 #include "execution.h" | 44 #include "execution.h" |
45 #include "global-handles.h" | 45 #include "global-handles.h" |
46 #include "isolate-inl.h" | 46 #include "isolate-inl.h" |
47 #include "jsregexp.h" | 47 #include "jsregexp.h" |
48 #include "json-parser.h" | 48 #include "json-parser.h" |
| 49 #include "json-stringifier.h" |
49 #include "liveedit.h" | 50 #include "liveedit.h" |
50 #include "liveobjectlist-inl.h" | 51 #include "liveobjectlist-inl.h" |
51 #include "misc-intrinsics.h" | 52 #include "misc-intrinsics.h" |
52 #include "parser.h" | 53 #include "parser.h" |
53 #include "platform.h" | 54 #include "platform.h" |
54 #include "runtime-profiler.h" | 55 #include "runtime-profiler.h" |
55 #include "runtime.h" | 56 #include "runtime.h" |
56 #include "scopeinfo.h" | 57 #include "scopeinfo.h" |
57 #include "smart-pointers.h" | 58 #include "smart-pointers.h" |
58 #include "string-search.h" | 59 #include "string-search.h" |
(...skipping 5694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5753 elements, | 5754 elements, |
5754 worst_case_length); | 5755 worst_case_length); |
5755 } else { | 5756 } else { |
5756 return QuoteJsonStringArray<uc16, SeqTwoByteString>(isolate, | 5757 return QuoteJsonStringArray<uc16, SeqTwoByteString>(isolate, |
5757 elements, | 5758 elements, |
5758 worst_case_length); | 5759 worst_case_length); |
5759 } | 5760 } |
5760 } | 5761 } |
5761 | 5762 |
5762 | 5763 |
| 5764 RUNTIME_FUNCTION(MaybeObject*, Runtime_BasicJSONStringify) { |
| 5765 ASSERT(args.length() == 1); |
| 5766 HandleScope scope(isolate); |
| 5767 BasicJsonStringifier stringifier(isolate); |
| 5768 return stringifier.Stringify(Handle<Object>(args[0])); |
| 5769 } |
| 5770 |
| 5771 |
5763 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringParseInt) { | 5772 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringParseInt) { |
5764 NoHandleAllocation ha; | 5773 NoHandleAllocation ha; |
5765 | 5774 |
5766 CONVERT_ARG_CHECKED(String, s, 0); | 5775 CONVERT_ARG_CHECKED(String, s, 0); |
5767 CONVERT_SMI_ARG_CHECKED(radix, 1); | 5776 CONVERT_SMI_ARG_CHECKED(radix, 1); |
5768 | 5777 |
5769 s->TryFlatten(); | 5778 s->TryFlatten(); |
5770 | 5779 |
5771 RUNTIME_ASSERT(radix == 0 || (2 <= radix && radix <= 36)); | 5780 RUNTIME_ASSERT(radix == 0 || (2 <= radix && radix <= 36)); |
5772 double value = StringToInt(isolate->unicode_cache(), s, radix); | 5781 double value = StringToInt(isolate->unicode_cache(), s, radix); |
(...skipping 7519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13292 // Handle last resort GC and make sure to allow future allocations | 13301 // Handle last resort GC and make sure to allow future allocations |
13293 // to grow the heap without causing GCs (if possible). | 13302 // to grow the heap without causing GCs (if possible). |
13294 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13303 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13295 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13304 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13296 "Runtime::PerformGC"); | 13305 "Runtime::PerformGC"); |
13297 } | 13306 } |
13298 } | 13307 } |
13299 | 13308 |
13300 | 13309 |
13301 } } // namespace v8::internal | 13310 } } // namespace v8::internal |
OLD | NEW |