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

Unified Diff: src/json-parser.h

Issue 211333002: Replace HeapNumber as doublebox with an explicit MutableHeapNumber. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic.cc ('k') | src/json-stringifier.h » ('j') | src/objects-debug.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.h
diff --git a/src/json-parser.h b/src/json-parser.h
index 4c2b479182db68654866d2fbb128dff6987548ed..83e84d7e5e75eaee23203beb479041f7406fa65e 100644
--- a/src/json-parser.h
+++ b/src/json-parser.h
@@ -414,9 +414,8 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
if (value->FitsRepresentation(expected_representation)) {
// If the target representation is double and the value is already
// double, use the existing box.
Igor Sheludko 2014/03/31 11:19:05 Please update comment to match the code.
- if (value->IsSmi() && expected_representation.IsDouble()) {
- value = factory()->NewHeapNumber(
- Handle<Smi>::cast(value)->value());
+ if (expected_representation.IsDouble()) {
+ value = factory()->NewHeapNumber(value->Number(), MUTABLE);
}
properties.Add(value, zone());
map = target;
« no previous file with comments | « src/ic.cc ('k') | src/json-stringifier.h » ('j') | src/objects-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698