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

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

Issue 608913002: Track references to allocation stubs via static_calls_table, instead of keeping two referencers ali… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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/compiler.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/class_finalizer.h" 6 #include "vm/class_finalizer.h"
7 #include "vm/code_patcher.h" 7 #include "vm/code_patcher.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 Class& cls = Class::Handle( 91 Class& cls = Class::Handle(
92 lib_handle.LookupClass(String::Handle(Symbols::New("A")))); 92 lib_handle.LookupClass(String::Handle(Symbols::New("A"))));
93 EXPECT(!cls.IsNull()); 93 EXPECT(!cls.IsNull());
94 94
95 Isolate* isolate = Isolate::Current(); 95 Isolate* isolate = Isolate::Current();
96 StubCode* stub_code = isolate->stub_code(); 96 StubCode* stub_code = isolate->stub_code();
97 const Code& stub = Code::Handle(isolate, 97 const Code& stub = Code::Handle(isolate,
98 stub_code->GetAllocationStubForClass(cls)); 98 stub_code->GetAllocationStubForClass(cls));
99 Class& owner = Class::Handle(); 99 Class& owner = Class::Handle();
100 owner ^= stub.owner(); 100 owner ^= stub.owner();
101 owner.SwitchAllocationStub(); 101 owner.DisableAllocationStub();
102 result = Dart_Invoke(lib, NewString("main"), 0, NULL); 102 result = Dart_Invoke(lib, NewString("main"), 0, NULL);
103 EXPECT_VALID(result); 103 EXPECT_VALID(result);
104 104
105 owner.SwitchAllocationStub(); 105 owner.DisableAllocationStub();
106 result = Dart_Invoke(lib, NewString("main"), 0, NULL); 106 result = Dart_Invoke(lib, NewString("main"), 0, NULL);
107 EXPECT_VALID(result); 107 EXPECT_VALID(result);
108 108
109 owner.SwitchAllocationStub(); 109 owner.DisableAllocationStub();
110 result = Dart_Invoke(lib, NewString("main"), 0, NULL); 110 result = Dart_Invoke(lib, NewString("main"), 0, NULL);
111 EXPECT_VALID(result); 111 EXPECT_VALID(result);
112 112
113 FLAG_enable_type_checks = old_enable_type_checks; 113 FLAG_enable_type_checks = old_enable_type_checks;
114 } 114 }
115 115
116 116
117 TEST_CASE(EvalExpression) { 117 TEST_CASE(EvalExpression) {
118 const char* kScriptChars = 118 const char* kScriptChars =
119 "int ten = 2 * 5; \n" 119 "int ten = 2 * 5; \n"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 val = lib.Evaluate(expression, Array::empty_array(), Array::empty_array()); 173 val = lib.Evaluate(expression, Array::empty_array(), Array::empty_array());
174 } 174 }
175 175
176 EXPECT(!val.IsNull()); 176 EXPECT(!val.IsNull());
177 EXPECT(!val.IsError()); 177 EXPECT(!val.IsError());
178 EXPECT(val.IsInteger()); 178 EXPECT(val.IsInteger());
179 EXPECT_EQ(7, Integer::Cast(val).AsInt64Value()); 179 EXPECT_EQ(7, Integer::Cast(val).AsInt64Value());
180 } 180 }
181 181
182 } // namespace dart 182 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698