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

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

Issue 372733003: Closure call inlining for constant closures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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 | « runtime/vm/flow_graph_inliner.cc ('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/cpu.h" 10 #include "vm/cpu.h"
(...skipping 6415 matching lines...) Expand 10 before | Expand all | Expand 10 after
6426 RawString* Function::GetSource() { 6426 RawString* Function::GetSource() {
6427 const Script& func_script = Script::Handle(script()); 6427 const Script& func_script = Script::Handle(script());
6428 // Without the + 1 the final "}" is not included. 6428 // Without the + 1 the final "}" is not included.
6429 return func_script.GetSnippet(token_pos(), end_token_pos() + 1); 6429 return func_script.GetSnippet(token_pos(), end_token_pos() + 1);
6430 } 6430 }
6431 6431
6432 6432
6433 // Construct fingerprint from token stream. The token stream contains also 6433 // Construct fingerprint from token stream. The token stream contains also
6434 // arguments. 6434 // arguments.
6435 int32_t Function::SourceFingerprint() const { 6435 int32_t Function::SourceFingerprint() const {
6436 uint32_t result = String::Handle(Signature()).Hash(); 6436 uint32_t result = IsImplicitClosureFunction()
6437 ? String::Handle(Function::Handle(parent_function()).Signature()).Hash()
6438 : String::Handle(Signature()).Hash();
6437 TokenStream::Iterator tokens_iterator(TokenStream::Handle( 6439 TokenStream::Iterator tokens_iterator(TokenStream::Handle(
6438 Script::Handle(script()).tokens()), token_pos()); 6440 Script::Handle(script()).tokens()), token_pos());
6439 Object& obj = Object::Handle(); 6441 Object& obj = Object::Handle();
6440 String& literal = String::Handle(); 6442 String& literal = String::Handle();
6441 while (tokens_iterator.CurrentPosition() < end_token_pos()) { 6443 while (tokens_iterator.CurrentPosition() < end_token_pos()) {
6442 uint32_t val = 0; 6444 uint32_t val = 0;
6443 obj = tokens_iterator.CurrentToken(); 6445 obj = tokens_iterator.CurrentToken();
6444 if (obj.IsSmi()) { 6446 if (obj.IsSmi()) {
6445 val = Smi::Cast(obj).Value(); 6447 val = Smi::Cast(obj).Value();
6446 } else { 6448 } else {
(...skipping 12588 matching lines...) Expand 10 before | Expand all | Expand 10 after
19035 return tag_label.ToCString(); 19037 return tag_label.ToCString();
19036 } 19038 }
19037 19039
19038 19040
19039 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19041 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19040 Instance::PrintJSONImpl(stream, ref); 19042 Instance::PrintJSONImpl(stream, ref);
19041 } 19043 }
19042 19044
19043 19045
19044 } // namespace dart 19046 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698