OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 3744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3755 // NewNumberFromDouble may return a Smi instead of a Number object | 3755 // NewNumberFromDouble may return a Smi instead of a Number object |
3756 return Heap::NewNumberFromDouble(x); | 3756 return Heap::NewNumberFromDouble(x); |
3757 } | 3757 } |
3758 | 3758 |
3759 | 3759 |
3760 static Object* Runtime_StringAdd(Arguments args) { | 3760 static Object* Runtime_StringAdd(Arguments args) { |
3761 NoHandleAllocation ha; | 3761 NoHandleAllocation ha; |
3762 ASSERT(args.length() == 2); | 3762 ASSERT(args.length() == 2); |
3763 CONVERT_CHECKED(String, str1, args[0]); | 3763 CONVERT_CHECKED(String, str1, args[0]); |
3764 CONVERT_CHECKED(String, str2, args[1]); | 3764 CONVERT_CHECKED(String, str2, args[1]); |
| 3765 Counters::cons_strings_runtime.Increment(); |
3765 return Heap::AllocateConsString(str1, str2); | 3766 return Heap::AllocateConsString(str1, str2); |
3766 } | 3767 } |
3767 | 3768 |
3768 | 3769 |
3769 template<typename sinkchar> | 3770 template<typename sinkchar> |
3770 static inline void StringBuilderConcatHelper(String* special, | 3771 static inline void StringBuilderConcatHelper(String* special, |
3771 sinkchar* sink, | 3772 sinkchar* sink, |
3772 FixedArray* fixed_array, | 3773 FixedArray* fixed_array, |
3773 int array_length) { | 3774 int array_length) { |
3774 int position = 0; | 3775 int position = 0; |
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4980 // If we have a string, assume it's a code "marker" | 4981 // If we have a string, assume it's a code "marker" |
4981 // and print some interesting cpu debugging info. | 4982 // and print some interesting cpu debugging info. |
4982 JavaScriptFrameIterator it; | 4983 JavaScriptFrameIterator it; |
4983 JavaScriptFrame* frame = it.frame(); | 4984 JavaScriptFrame* frame = it.frame(); |
4984 PrintF("fp = %p, sp = %p, caller_sp = %p: ", | 4985 PrintF("fp = %p, sp = %p, caller_sp = %p: ", |
4985 frame->fp(), frame->sp(), frame->caller_sp()); | 4986 frame->fp(), frame->sp(), frame->caller_sp()); |
4986 } else { | 4987 } else { |
4987 PrintF("DebugPrint: "); | 4988 PrintF("DebugPrint: "); |
4988 } | 4989 } |
4989 args[0]->Print(); | 4990 args[0]->Print(); |
| 4991 if (args[0]->IsHeapObject()) { |
| 4992 HeapObject::cast(args[0])->map()->Print(); |
| 4993 } |
4990 #else | 4994 #else |
4991 // ShortPrint is available in release mode. Print is not. | 4995 // ShortPrint is available in release mode. Print is not. |
4992 args[0]->ShortPrint(); | 4996 args[0]->ShortPrint(); |
4993 #endif | 4997 #endif |
4994 PrintF("\n"); | 4998 PrintF("\n"); |
4995 Flush(); | 4999 Flush(); |
4996 | 5000 |
4997 return args[0]; // return TOS | 5001 return args[0]; // return TOS |
4998 } | 5002 } |
4999 | 5003 |
(...skipping 2911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7911 } else { | 7915 } else { |
7912 // Handle last resort GC and make sure to allow future allocations | 7916 // Handle last resort GC and make sure to allow future allocations |
7913 // to grow the heap without causing GCs (if possible). | 7917 // to grow the heap without causing GCs (if possible). |
7914 Counters::gc_last_resort_from_js.Increment(); | 7918 Counters::gc_last_resort_from_js.Increment(); |
7915 Heap::CollectAllGarbage(false); | 7919 Heap::CollectAllGarbage(false); |
7916 } | 7920 } |
7917 } | 7921 } |
7918 | 7922 |
7919 | 7923 |
7920 } } // namespace v8::internal | 7924 } } // namespace v8::internal |
OLD | NEW |