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

Side by Side Diff: src/json-stringifier.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, 8 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
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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 if (object.is_null()) return EXCEPTION; 423 if (object.is_null()) return EXCEPTION;
424 } 424 }
425 425
426 if (object->IsSmi()) { 426 if (object->IsSmi()) {
427 if (deferred_string_key) SerializeDeferredKey(comma, key); 427 if (deferred_string_key) SerializeDeferredKey(comma, key);
428 return SerializeSmi(Smi::cast(*object)); 428 return SerializeSmi(Smi::cast(*object));
429 } 429 }
430 430
431 switch (HeapObject::cast(*object)->map()->instance_type()) { 431 switch (HeapObject::cast(*object)->map()->instance_type()) {
432 case HEAP_NUMBER_TYPE: 432 case HEAP_NUMBER_TYPE:
433 case MUTABLE_HEAP_NUMBER_TYPE:
433 if (deferred_string_key) SerializeDeferredKey(comma, key); 434 if (deferred_string_key) SerializeDeferredKey(comma, key);
434 return SerializeHeapNumber(Handle<HeapNumber>::cast(object)); 435 return SerializeHeapNumber(Handle<HeapNumber>::cast(object));
435 case ODDBALL_TYPE: 436 case ODDBALL_TYPE:
436 switch (Oddball::cast(*object)->kind()) { 437 switch (Oddball::cast(*object)->kind()) {
437 case Oddball::kFalse: 438 case Oddball::kFalse:
438 if (deferred_string_key) SerializeDeferredKey(comma, key); 439 if (deferred_string_key) SerializeDeferredKey(comma, key);
439 AppendAscii("false"); 440 AppendAscii("false");
440 return SUCCESS; 441 return SUCCESS;
441 case Oddball::kTrue: 442 case Oddball::kTrue:
442 if (deferred_string_key) SerializeDeferredKey(comma, key); 443 if (deferred_string_key) SerializeDeferredKey(comma, key);
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 SerializeString_<false, uint8_t>(object); 878 SerializeString_<false, uint8_t>(object);
878 } else { 879 } else {
879 SerializeString_<false, uc16>(object); 880 SerializeString_<false, uc16>(object);
880 } 881 }
881 } 882 }
882 } 883 }
883 884
884 } } // namespace v8::internal 885 } } // namespace v8::internal
885 886
886 #endif // V8_JSON_STRINGIFIER_H_ 887 #endif // V8_JSON_STRINGIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698