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

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

Issue 11412137: Reenable function source fingerprint checks. Added checks to MethodRecognizer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | « runtime/vm/object.h ('k') | 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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 4197 matching lines...) Expand 10 before | Expand all | Expand 10 after
4208 obj = tokens_iterator.CurrentToken(); 4208 obj = tokens_iterator.CurrentToken();
4209 if (obj.IsSmi()) { 4209 if (obj.IsSmi()) {
4210 val = Smi::Cast(obj).Value(); 4210 val = Smi::Cast(obj).Value();
4211 } else { 4211 } else {
4212 literal = tokens_iterator.MakeLiteralToken(obj); 4212 literal = tokens_iterator.MakeLiteralToken(obj);
4213 val = literal.Hash(); 4213 val = literal.Hash();
4214 } 4214 }
4215 result = 31 * result + val; 4215 result = 31 * result + val;
4216 tokens_iterator.Advance(); 4216 tokens_iterator.Advance();
4217 } 4217 }
4218 result = result & ((static_cast<intptr_t>(1) << 30) - 1); 4218 result = result & ((static_cast<uint32_t>(1) << 31) - 1);
4219 ASSERT(result <= static_cast<uint32_t>(kMaxInt32)); 4219 ASSERT(result <= static_cast<uint32_t>(kMaxInt32));
4220 return result; 4220 return result;
4221 } 4221 }
4222 4222
4223 4223
4224 bool Function::CheckSourceFingerprint(intptr_t fp) const {
4225 if (SourceFingerprint() != fp) {
4226 OS::Print("FP mismatch while recogbnizing method %s:"
4227 " expecting %"Pd" found %d\n",
4228 ToFullyQualifiedCString(),
4229 fp,
4230 SourceFingerprint());
4231 return false;
4232 }
4233 return true;
4234 }
4235
4236
4224 const char* Function::ToCString() const { 4237 const char* Function::ToCString() const {
4225 const char* static_str = is_static() ? " static" : ""; 4238 const char* static_str = is_static() ? " static" : "";
4226 const char* abstract_str = is_abstract() ? " abstract" : ""; 4239 const char* abstract_str = is_abstract() ? " abstract" : "";
4227 const char* kind_str = NULL; 4240 const char* kind_str = NULL;
4228 const char* const_str = is_const() ? " const" : ""; 4241 const char* const_str = is_const() ? " const" : "";
4229 switch (kind()) { 4242 switch (kind()) {
4230 case RawFunction::kRegularFunction: 4243 case RawFunction::kRegularFunction:
4231 case RawFunction::kClosureFunction: 4244 case RawFunction::kClosureFunction:
4232 case RawFunction::kGetterFunction: 4245 case RawFunction::kGetterFunction:
4233 case RawFunction::kSetterFunction: 4246 case RawFunction::kSetterFunction:
(...skipping 7958 matching lines...) Expand 10 before | Expand all | Expand 10 after
12192 } 12205 }
12193 return result.raw(); 12206 return result.raw();
12194 } 12207 }
12195 12208
12196 12209
12197 const char* WeakProperty::ToCString() const { 12210 const char* WeakProperty::ToCString() const {
12198 return "_WeakProperty"; 12211 return "_WeakProperty";
12199 } 12212 }
12200 12213
12201 } // namespace dart 12214 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698