| OLD | NEW |
| 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 "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/class_finalizer.h" | 6 #include "vm/class_finalizer.h" |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 | 117 |
| 118 TEST_CASE(EvalExpressionExhaustCIDs) { | 118 TEST_CASE(EvalExpressionExhaustCIDs) { |
| 119 Library& lib = Library::Handle(Library::CoreLibrary()); | 119 Library& lib = Library::Handle(Library::CoreLibrary()); |
| 120 | 120 |
| 121 const String& expression = String::Handle(String::New("3 + 4")); | 121 const String& expression = String::Handle(String::New("3 + 4")); |
| 122 Object& val = Object::Handle(); | 122 Object& val = Object::Handle(); |
| 123 | 123 |
| 124 const intptr_t classTableSize = 1 << RawObject::kClassIdTagSize; | 124 const intptr_t classTableSize = 1 << RawObject::kClassIdTagSize; |
| 125 for (intptr_t i = 0; i < classTableSize; i++) { | 125 for (intptr_t i = 0; i < classTableSize; i++) { |
| 126 StackZone zone(Isolate::Current()); |
| 126 val = lib.Evaluate(expression, Array::empty_array(), Array::empty_array()); | 127 val = lib.Evaluate(expression, Array::empty_array(), Array::empty_array()); |
| 127 } | 128 } |
| 128 | 129 |
| 129 EXPECT(!val.IsNull()); | 130 EXPECT(!val.IsNull()); |
| 130 EXPECT(!val.IsError()); | 131 EXPECT(!val.IsError()); |
| 131 EXPECT(val.IsInteger()); | 132 EXPECT(val.IsInteger()); |
| 132 EXPECT_EQ(7, Integer::Cast(val).AsInt64Value()); | 133 EXPECT_EQ(7, Integer::Cast(val).AsInt64Value()); |
| 133 } | 134 } |
| 134 | 135 |
| 135 } // namespace dart | 136 } // namespace dart |
| OLD | NEW |