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

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

Issue 221173011: Simplify handling of IC and megamorphic cache misses. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.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/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 "class StackFrame {" 250 "class StackFrame {"
251 " static equals(var obj1, var obj2) native \"StackFrame_equals\";" 251 " static equals(var obj1, var obj2) native \"StackFrame_equals\";"
252 " static int frameCount() native \"StackFrame_frameCount\";" 252 " static int frameCount() native \"StackFrame_frameCount\";"
253 " static int dartFrameCount() native \"StackFrame_dartFrameCount\";" 253 " static int dartFrameCount() native \"StackFrame_dartFrameCount\";"
254 " static validateFrame(int index," 254 " static validateFrame(int index,"
255 " String name) native \"StackFrame_validateFrame\";" 255 " String name) native \"StackFrame_validateFrame\";"
256 "} " 256 "} "
257 "class StackFrame2Test {" 257 "class StackFrame2Test {"
258 " StackFrame2Test() {}" 258 " StackFrame2Test() {}"
259 " noSuchMethod(Invocation im) {" 259 " noSuchMethod(Invocation im) {"
260 " /* We should have 8 general frames and 3 dart frames as follows:" 260 " /* We should have 6 general frames and 4 dart frames as follows:"
261 " * exit frame" 261 " * exit frame"
262 " * dart frame corresponding to StackFrame.frameCount" 262 " * dart frame corresponding to StackFrame.frameCount"
263 " * dart frame corresponding to StackFrame2Test.noSuchMethod" 263 " * dart frame corresponding to StackFrame2Test.noSuchMethod"
264 " * entry frame"
265 " * exit frame"
266 " * frame for instance function invocation stub calling noSuchMethod" 264 " * frame for instance function invocation stub calling noSuchMethod"
267 " * dart frame corresponding to StackFrame2Test.testMain" 265 " * dart frame corresponding to StackFrame2Test.testMain"
268 " * entry frame" 266 " * entry frame"
269 " */" 267 " */"
270 " StackFrame.equals(9, StackFrame.frameCount());" 268 " StackFrame.equals(6, StackFrame.frameCount());"
271 " StackFrame.equals(4, StackFrame.dartFrameCount());" 269 " StackFrame.equals(4, StackFrame.dartFrameCount());"
272 " StackFrame.validateFrame(0, \"StackFrame_validateFrame\");" 270 " StackFrame.validateFrame(0, \"StackFrame_validateFrame\");"
273 " StackFrame.validateFrame(1, \"StackFrame2Test_noSuchMethod\");" 271 " StackFrame.validateFrame(1, \"StackFrame2Test_noSuchMethod\");"
274 " StackFrame.validateFrame(2, \"StackFrame2Test_foo\");" 272 " StackFrame.validateFrame(2, \"StackFrame2Test_foo\");"
275 " StackFrame.validateFrame(3, \"StackFrame2Test_testMain\");" 273 " StackFrame.validateFrame(3, \"StackFrame2Test_testMain\");"
276 " return 5;" 274 " return 5;"
277 " }" 275 " }"
278 " static testMain() {" 276 " static testMain() {"
279 " var obj = new StackFrame2Test();" 277 " var obj = new StackFrame2Test();"
280 " StackFrame.equals(5, obj.foo(101, 202));" 278 " StackFrame.equals(5, obj.foo(101, 202));"
281 " }" 279 " }"
282 "}"; 280 "}";
283 Dart_Handle lib = TestCase::LoadTestScript( 281 Dart_Handle lib = TestCase::LoadTestScript(
284 kScriptChars, 282 kScriptChars,
285 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); 283 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
286 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test")); 284 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test"));
287 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL)); 285 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL));
288 } 286 }
289 287
290 } // namespace dart 288 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698