Chromium Code Reviews| 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 5937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5948 static_cast<int>(hash)); | 5948 static_cast<int>(hash)); |
| 5949 #endif | 5949 #endif |
| 5950 subject->set_hash_field(hash); | 5950 subject->set_hash_field(hash); |
| 5951 } | 5951 } |
| 5952 return Smi::FromInt(d); | 5952 return Smi::FromInt(d); |
| 5953 } | 5953 } |
| 5954 } | 5954 } |
| 5955 | 5955 |
| 5956 // Slower case. | 5956 // Slower case. |
| 5957 return isolate->heap()->NumberFromDouble( | 5957 return isolate->heap()->NumberFromDouble( |
| 5958 StringToDouble(isolate->unicode_cache(), subject, ALLOW_HEX)); | 5958 StringToDouble(isolate->unicode_cache(), subject, ALLOW_HEX | ALLOW_OCTAL | ALLOW_BINARY)); |
|
rossberg
2013/07/16 13:26:25
Nit: line length
| |
| 5959 } | 5959 } |
| 5960 | 5960 |
| 5961 | 5961 |
| 5962 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewString) { | 5962 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewString) { |
| 5963 SealHandleScope shs(isolate); | 5963 SealHandleScope shs(isolate); |
| 5964 CONVERT_SMI_ARG_CHECKED(length, 0); | 5964 CONVERT_SMI_ARG_CHECKED(length, 0); |
| 5965 CONVERT_BOOLEAN_ARG_CHECKED(is_one_byte, 1); | 5965 CONVERT_BOOLEAN_ARG_CHECKED(is_one_byte, 1); |
| 5966 if (length == 0) return isolate->heap()->empty_string(); | 5966 if (length == 0) return isolate->heap()->empty_string(); |
| 5967 if (is_one_byte) { | 5967 if (is_one_byte) { |
| 5968 return isolate->heap()->AllocateRawOneByteString(length); | 5968 return isolate->heap()->AllocateRawOneByteString(length); |
| (...skipping 8109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14078 // Handle last resort GC and make sure to allow future allocations | 14078 // Handle last resort GC and make sure to allow future allocations |
| 14079 // to grow the heap without causing GCs (if possible). | 14079 // to grow the heap without causing GCs (if possible). |
| 14080 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14080 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14081 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14081 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14082 "Runtime::PerformGC"); | 14082 "Runtime::PerformGC"); |
| 14083 } | 14083 } |
| 14084 } | 14084 } |
| 14085 | 14085 |
| 14086 | 14086 |
| 14087 } } // namespace v8::internal | 14087 } } // namespace v8::internal |
| OLD | NEW |