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

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

Issue 12260026: Add support for object pool (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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/instructions_x64_test.cc ('k') | runtime/vm/object.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/native_entry_test.h" 5 #include "vm/native_entry_test.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/native_entry.h" 10 #include "vm/native_entry.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 Dart_ExitScope(); 87 Dart_ExitScope();
88 } 88 }
89 89
90 90
91 // Test code patching. 91 // Test code patching.
92 void TestStaticCallPatching(Dart_NativeArguments args) { 92 void TestStaticCallPatching(Dart_NativeArguments args) {
93 Dart_EnterScope(); 93 Dart_EnterScope();
94 DartFrameIterator iterator; 94 DartFrameIterator iterator;
95 iterator.NextFrame(); // Skip native call. 95 iterator.NextFrame(); // Skip native call.
96 StackFrame* static_caller_frame = iterator.NextFrame(); 96 StackFrame* static_caller_frame = iterator.NextFrame();
97 const Code& code = Code::Handle(static_caller_frame->LookupDartCode());
97 uword target_address = 98 uword target_address =
98 CodePatcher::GetStaticCallTargetAt(static_caller_frame->pc()); 99 CodePatcher::GetStaticCallTargetAt(static_caller_frame->pc(), code);
99 const Code& code = Code::Handle(static_caller_frame->LookupDartCode());
100 const Function& target_function = 100 const Function& target_function =
101 Function::Handle(code.GetStaticCallTargetFunctionAt( 101 Function::Handle(code.GetStaticCallTargetFunctionAt(
102 static_caller_frame->pc())); 102 static_caller_frame->pc()));
103 EXPECT(String::Handle(target_function.name()). 103 EXPECT(String::Handle(target_function.name()).
104 Equals(String::Handle(String::New("NativePatchStaticCall")))); 104 Equals(String::Handle(String::New("NativePatchStaticCall"))));
105 const uword function_entry_address = 105 const uword function_entry_address =
106 Code::Handle(target_function.CurrentCode()).EntryPoint(); 106 Code::Handle(target_function.CurrentCode()).EntryPoint();
107 EXPECT_EQ(function_entry_address, target_address); 107 EXPECT_EQ(function_entry_address, target_address);
108 Dart_ExitScope(); 108 Dart_ExitScope();
109 } 109 }
110 110
111 } // namespace dart 111 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/instructions_x64_test.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698