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

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: Fix long lines 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.h » ('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 5941 matching lines...) Expand 10 before | Expand all | Expand 10 after
5952 ASSERT_EQ(static_cast<int>(subject->hash_field()), 5952 ASSERT_EQ(static_cast<int>(subject->hash_field()),
5953 static_cast<int>(hash)); 5953 static_cast<int>(hash));
5954 #endif 5954 #endif
5955 subject->set_hash_field(hash); 5955 subject->set_hash_field(hash);
5956 } 5956 }
5957 return Smi::FromInt(d); 5957 return Smi::FromInt(d);
5958 } 5958 }
5959 } 5959 }
5960 5960
5961 // Slower case. 5961 // Slower case.
5962 int flags = ALLOW_HEX;
5963 if (FLAG_harmony_numeric_literals) {
5964 // The current spec draft has not updated "ToNumber Applied to the String
5965 // Type", https://bugs.ecmascript.org/show_bug.cgi?id=1584
5966 flags |= ALLOW_OCTAL | ALLOW_BINARY;
5967 }
5962 return isolate->heap()->NumberFromDouble( 5968 return isolate->heap()->NumberFromDouble(
5963 StringToDouble(isolate->unicode_cache(), subject, ALLOW_HEX)); 5969 StringToDouble(isolate->unicode_cache(), subject, flags));
5964 } 5970 }
5965 5971
5966 5972
5967 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewString) { 5973 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewString) {
5968 SealHandleScope shs(isolate); 5974 SealHandleScope shs(isolate);
5969 CONVERT_SMI_ARG_CHECKED(length, 0); 5975 CONVERT_SMI_ARG_CHECKED(length, 0);
5970 CONVERT_BOOLEAN_ARG_CHECKED(is_one_byte, 1); 5976 CONVERT_BOOLEAN_ARG_CHECKED(is_one_byte, 1);
5971 if (length == 0) return isolate->heap()->empty_string(); 5977 if (length == 0) return isolate->heap()->empty_string();
5972 if (is_one_byte) { 5978 if (is_one_byte) {
5973 return isolate->heap()->AllocateRawOneByteString(length); 5979 return isolate->heap()->AllocateRawOneByteString(length);
(...skipping 8011 matching lines...) Expand 10 before | Expand all | Expand 10 after
13985 // Handle last resort GC and make sure to allow future allocations 13991 // Handle last resort GC and make sure to allow future allocations
13986 // to grow the heap without causing GCs (if possible). 13992 // to grow the heap without causing GCs (if possible).
13987 isolate->counters()->gc_last_resort_from_js()->Increment(); 13993 isolate->counters()->gc_last_resort_from_js()->Increment();
13988 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13994 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13989 "Runtime::PerformGC"); 13995 "Runtime::PerformGC");
13990 } 13996 }
13991 } 13997 }
13992 13998
13993 13999
13994 } } // namespace v8::internal 14000 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | src/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698