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

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

Issue 265443002: VM: Explicitly load function and context before calling a closure. (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
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 13830 matching lines...) Expand 10 before | Expand all | Expand 10 after
13841 if (IsCanonical() || IsMalformed()) { 13841 if (IsCanonical() || IsMalformed()) {
13842 ASSERT(IsMalformed() || TypeArguments::Handle(arguments()).IsOld()); 13842 ASSERT(IsMalformed() || TypeArguments::Handle(arguments()).IsOld());
13843 return this->raw(); 13843 return this->raw();
13844 } 13844 }
13845 Isolate* isolate = Isolate::Current(); 13845 Isolate* isolate = Isolate::Current();
13846 Type& type = Type::Handle(isolate); 13846 Type& type = Type::Handle(isolate);
13847 const Class& cls = Class::Handle(isolate, type_class()); 13847 const Class& cls = Class::Handle(isolate, type_class());
13848 if (cls.raw() == Object::dynamic_class() && (isolate != Dart::vm_isolate())) { 13848 if (cls.raw() == Object::dynamic_class() && (isolate != Dart::vm_isolate())) {
13849 return Object::dynamic_type(); 13849 return Object::dynamic_type();
13850 } 13850 }
13851 if (cls.raw() == Object::function_class() &&
srdjan 2014/04/30 15:41:58 cls.IsFunctionClass()
Florian Schneider 2014/04/30 16:02:19 This seems equivalent and consistent with the code
13852 (isolate != Dart::vm_isolate())) {
13853 return Object::dynamic_type();
srdjan 2014/04/30 15:41:58 I would like to have Regis look into this change.
Florian Schneider 2014/04/30 16:02:19 Now that I look at it again, actually, this should
Florian Schneider 2014/04/30 16:05:24 No, not function_type, but the type corresponding
regis 2014/04/30 16:46:39 I fail to see what problem you are trying to solve
13854 }
13851 // Fast canonical lookup/registry for simple types. 13855 // Fast canonical lookup/registry for simple types.
13852 if ((cls.NumTypeArguments() == 0) && !cls.IsSignatureClass()) { 13856 if ((cls.NumTypeArguments() == 0) && !cls.IsSignatureClass()) {
13853 type = cls.CanonicalType(); 13857 type = cls.CanonicalType();
13854 if (type.IsNull()) { 13858 if (type.IsNull()) {
13855 ASSERT(!cls.raw()->IsVMHeapObject() || (isolate == Dart::vm_isolate())); 13859 ASSERT(!cls.raw()->IsVMHeapObject() || (isolate == Dart::vm_isolate()));
13856 cls.set_canonical_types(*this); 13860 cls.set_canonical_types(*this);
13857 SetCanonical(); 13861 SetCanonical();
13858 return this->raw(); 13862 return this->raw();
13859 } 13863 }
13860 ASSERT(this->Equals(type)); 13864 ASSERT(this->Equals(type));
(...skipping 4808 matching lines...) Expand 10 before | Expand all | Expand 10 after
18669 return tag_label.ToCString(); 18673 return tag_label.ToCString();
18670 } 18674 }
18671 18675
18672 18676
18673 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 18677 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
18674 Instance::PrintJSONImpl(stream, ref); 18678 Instance::PrintJSONImpl(stream, ref);
18675 } 18679 }
18676 18680
18677 18681
18678 } // namespace dart 18682 } // namespace dart
OLDNEW
« runtime/vm/flow_graph_compiler.h ('K') | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698