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

Side by Side Diff: runtime/vm/object.cc

Issue 281983002: Add asserts to verify handle is always non null and the kIDENT literal (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 7393 matching lines...) Expand 10 before | Expand all | Expand 10 after
7404 token_obj_(Object::Handle()), 7404 token_obj_(Object::Handle()),
7405 literal_token_(LiteralToken::Handle()), 7405 literal_token_(LiteralToken::Handle()),
7406 literal_str_(String::Handle()) { 7406 literal_str_(String::Handle()) {
7407 token_objects_.Add(Object::null_string()); 7407 token_objects_.Add(Object::null_string());
7408 } 7408 }
7409 ~CompressedTokenStreamData() { 7409 ~CompressedTokenStreamData() {
7410 } 7410 }
7411 7411
7412 // Add an IDENT token into the stream and the token objects array. 7412 // Add an IDENT token into the stream and the token objects array.
7413 void AddIdentToken(const String* ident) { 7413 void AddIdentToken(const String* ident) {
7414 if (ident != NULL) { 7414 ASSERT(ident != NULL);
7415 // If the IDENT token is already in the tokens object array use the 7415 ASSERT(ident->IsSymbol());
7416 // same index instead of duplicating it. 7416 // If the IDENT token is already in the tokens object array use the
7417 intptr_t index = FindIdentIndex(ident); 7417 // same index instead of duplicating it.
7418 if (index == -1) { 7418 intptr_t index = FindIdentIndex(ident);
7419 WriteIndex(token_objects_.Length()); 7419 if (index == -1) {
7420 ASSERT(ident != NULL); 7420 WriteIndex(token_objects_.Length());
7421 token_objects_.Add(*ident); 7421 ASSERT(ident != NULL);
7422 } else { 7422 token_objects_.Add(*ident);
7423 WriteIndex(index);
7424 }
7425 } else { 7423 } else {
7426 WriteIndex(0); 7424 WriteIndex(index);
7427 } 7425 }
7428 } 7426 }
7429 7427
7430 // Add a LITERAL token into the stream and the token objects array. 7428 // Add a LITERAL token into the stream and the token objects array.
7431 void AddLiteralToken(Token::Kind kind, const String* literal) { 7429 void AddLiteralToken(Token::Kind kind, const String* literal) {
7432 if (literal != NULL) { 7430 if (literal != NULL) {
7433 // If the literal token is already in the tokens object array use the 7431 // If the literal token is already in the tokens object array use the
7434 // same index instead of duplicating it. 7432 // same index instead of duplicating it.
7435 intptr_t index = FindLiteralIndex(kind, literal); 7433 intptr_t index = FindLiteralIndex(kind, literal);
7436 if (index == -1) { 7434 if (index == -1) {
(...skipping 11421 matching lines...) Expand 10 before | Expand all | Expand 10 after
18858 return tag_label.ToCString(); 18856 return tag_label.ToCString();
18859 } 18857 }
18860 18858
18861 18859
18862 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 18860 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
18863 Instance::PrintJSONImpl(stream, ref); 18861 Instance::PrintJSONImpl(stream, ref);
18864 } 18862 }
18865 18863
18866 18864
18867 } // namespace dart 18865 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698