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

Side by Side Diff: src/runtime.cc

Issue 19300002: ES6: Add support for explicit octal and binary integer literals (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/preparser.cc ('k') | src/scanner.cc » ('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 // 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
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
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
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | src/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698