OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
6 | 6 |
7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
9 #include "vm/json_stream.h" | 9 #include "vm/json_stream.h" |
10 #include "vm/message.h" | 10 #include "vm/message.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 | 268 |
269 | 269 |
270 void JSONStream::PrintPropertyBool(const char* name, bool b) { | 270 void JSONStream::PrintPropertyBool(const char* name, bool b) { |
271 PrintPropertyName(name); | 271 PrintPropertyName(name); |
272 PrintValueBool(b); | 272 PrintValueBool(b); |
273 } | 273 } |
274 | 274 |
275 | 275 |
276 void JSONStream::PrintProperty(const char* name, intptr_t i) { | 276 void JSONStream::PrintProperty(const char* name, intptr_t i) { |
277 PrintPropertyName(name); | 277 PrintPropertyName(name); |
278 PrintValue(i); | 278 PrintValue(i); |
Cutch
2015/03/18 20:05:48
Need JavaScript range ASSERT here too (for 64-bit
turnidge
2015/03/26 17:46:58
Done.
| |
279 } | 279 } |
280 | 280 |
281 | 281 |
282 void JSONStream::PrintProperty64(const char* name, int64_t i) { | 282 void JSONStream::PrintProperty64(const char* name, int64_t i) { |
283 // dart2js represents integers as double precision floats, which can | |
284 // represent anything in the range -2^53 ... 2^53. | |
285 ASSERT((-0x20000000000000LL <= i) && (i <= 0x20000000000000LL)); | |
Cutch
2015/03/18 20:05:48
How about:
#define MAX_JAVASCRIPT_INT 0x2000000000
turnidge
2015/03/26 17:46:58
Added IsJavascriptInt to utils.h.
| |
283 PrintPropertyName(name); | 286 PrintPropertyName(name); |
284 PrintValue64(i); | 287 PrintValue64(i); |
285 } | 288 } |
286 | 289 |
287 | 290 |
288 void JSONStream::PrintProperty(const char* name, double d) { | 291 void JSONStream::PrintProperty(const char* name, double d) { |
289 PrintPropertyName(name); | 292 PrintPropertyName(name); |
290 PrintValue(d); | 293 PrintValue(d); |
291 } | 294 } |
292 | 295 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); | 486 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); |
484 va_end(args); | 487 va_end(args); |
485 ASSERT(len == len2); | 488 ASSERT(len == len2); |
486 stream_->buffer_.AddChar('"'); | 489 stream_->buffer_.AddChar('"'); |
487 stream_->AddEscapedUTF8String(p); | 490 stream_->AddEscapedUTF8String(p); |
488 stream_->buffer_.AddChar('"'); | 491 stream_->buffer_.AddChar('"'); |
489 free(p); | 492 free(p); |
490 } | 493 } |
491 | 494 |
492 } // namespace dart | 495 } // namespace dart |
OLD | NEW |