Chromium Code Reviews| 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 "vm/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 } | 102 } |
| 103 | 103 |
| 104 | 104 |
| 105 // Allocate a new object. | 105 // Allocate a new object. |
| 106 // Arg0: class of the object that needs to be allocated. | 106 // Arg0: class of the object that needs to be allocated. |
| 107 // Arg1: type arguments of the object that needs to be allocated. | 107 // Arg1: type arguments of the object that needs to be allocated. |
| 108 // Arg2: type arguments of the instantiator or kNoInstantiator. | 108 // Arg2: type arguments of the instantiator or kNoInstantiator. |
| 109 // Return value: newly allocated object. | 109 // Return value: newly allocated object. |
| 110 DEFINE_RUNTIME_ENTRY(AllocateObject, 3) { | 110 DEFINE_RUNTIME_ENTRY(AllocateObject, 3) { |
| 111 const Class& cls = Class::CheckedHandle(arguments.ArgAt(0)); | 111 const Class& cls = Class::CheckedHandle(arguments.ArgAt(0)); |
| 112 // Report allocate to heap class stats. | |
|
Ivan Posva
2013/12/12 13:53:24
?
Cutch
2013/12/13 01:31:09
Dead code with a zombie comment.
| |
| 112 const Instance& instance = Instance::Handle(Instance::New(cls)); | 113 const Instance& instance = Instance::Handle(Instance::New(cls)); |
| 113 arguments.SetReturn(instance); | 114 arguments.SetReturn(instance); |
| 114 if (cls.NumTypeArguments() == 0) { | 115 if (cls.NumTypeArguments() == 0) { |
| 115 // No type arguments required for a non-parameterized type. | 116 // No type arguments required for a non-parameterized type. |
| 116 ASSERT(Instance::CheckedHandle(arguments.ArgAt(1)).IsNull()); | 117 ASSERT(Instance::CheckedHandle(arguments.ArgAt(1)).IsNull()); |
| 117 return; | 118 return; |
| 118 } | 119 } |
| 119 AbstractTypeArguments& type_arguments = | 120 AbstractTypeArguments& type_arguments = |
| 120 AbstractTypeArguments::CheckedHandle(arguments.ArgAt(1)); | 121 AbstractTypeArguments::CheckedHandle(arguments.ArgAt(1)); |
| 121 // If no instantiator is provided, set the type arguments and return. | 122 // If no instantiator is provided, set the type arguments and return. |
| (...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1701 // of the given value. | 1702 // of the given value. |
| 1702 // Arg0: Field object; | 1703 // Arg0: Field object; |
| 1703 // Arg1: Value that is being stored. | 1704 // Arg1: Value that is being stored. |
| 1704 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { | 1705 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { |
| 1705 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1706 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
| 1706 const Object& value = Object::Handle(arguments.ArgAt(1)); | 1707 const Object& value = Object::Handle(arguments.ArgAt(1)); |
| 1707 field.UpdateGuardedCidAndLength(value); | 1708 field.UpdateGuardedCidAndLength(value); |
| 1708 } | 1709 } |
| 1709 | 1710 |
| 1710 } // namespace dart | 1711 } // namespace dart |
| OLD | NEW |