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" | |
50 #include "liveedit.h" | 49 #include "liveedit.h" |
51 #include "liveobjectlist-inl.h" | 50 #include "liveobjectlist-inl.h" |
52 #include "misc-intrinsics.h" | 51 #include "misc-intrinsics.h" |
53 #include "parser.h" | 52 #include "parser.h" |
54 #include "platform.h" | 53 #include "platform.h" |
55 #include "runtime-profiler.h" | 54 #include "runtime-profiler.h" |
56 #include "runtime.h" | 55 #include "runtime.h" |
57 #include "scopeinfo.h" | 56 #include "scopeinfo.h" |
58 #include "smart-pointers.h" | 57 #include "smart-pointers.h" |
59 #include "string-search.h" | 58 #include "string-search.h" |
(...skipping 5694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5754 elements, | 5753 elements, |
5755 worst_case_length); | 5754 worst_case_length); |
5756 } else { | 5755 } else { |
5757 return QuoteJsonStringArray<uc16, SeqTwoByteString>(isolate, | 5756 return QuoteJsonStringArray<uc16, SeqTwoByteString>(isolate, |
5758 elements, | 5757 elements, |
5759 worst_case_length); | 5758 worst_case_length); |
5760 } | 5759 } |
5761 } | 5760 } |
5762 | 5761 |
5763 | 5762 |
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 | |
5772 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringParseInt) { | 5763 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringParseInt) { |
5773 NoHandleAllocation ha; | 5764 NoHandleAllocation ha; |
5774 | 5765 |
5775 CONVERT_ARG_CHECKED(String, s, 0); | 5766 CONVERT_ARG_CHECKED(String, s, 0); |
5776 CONVERT_SMI_ARG_CHECKED(radix, 1); | 5767 CONVERT_SMI_ARG_CHECKED(radix, 1); |
5777 | 5768 |
5778 s->TryFlatten(); | 5769 s->TryFlatten(); |
5779 | 5770 |
5780 RUNTIME_ASSERT(radix == 0 || (2 <= radix && radix <= 36)); | 5771 RUNTIME_ASSERT(radix == 0 || (2 <= radix && radix <= 36)); |
5781 double value = StringToInt(isolate->unicode_cache(), s, radix); | 5772 double value = StringToInt(isolate->unicode_cache(), s, radix); |
(...skipping 7519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13301 // Handle last resort GC and make sure to allow future allocations | 13292 // Handle last resort GC and make sure to allow future allocations |
13302 // to grow the heap without causing GCs (if possible). | 13293 // to grow the heap without causing GCs (if possible). |
13303 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13294 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13304 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13295 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13305 "Runtime::PerformGC"); | 13296 "Runtime::PerformGC"); |
13306 } | 13297 } |
13307 } | 13298 } |
13308 | 13299 |
13309 | 13300 |
13310 } } // namespace v8::internal | 13301 } } // namespace v8::internal |
OLD | NEW |