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/object.h" | 8 #include "vm/object.h" |
9 #include "vm/pages.h" | 9 #include "vm/pages.h" |
10 #include "vm/stack_frame.h" | 10 #include "vm/stack_frame.h" |
11 #include "vm/symbols.h" | 11 #include "vm/symbols.h" |
12 #include "vm/unit_test.h" | 12 #include "vm/unit_test.h" |
13 | 13 |
14 namespace dart { | 14 namespace dart { |
15 | 15 |
16 TEST_CASE(FindCodeObject) { | 16 TEST_CASE(FindCodeObject) { |
17 #if defined(TARGET_ARCH_IA32) | 17 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
18 const int kLoopCount = 50000; | 18 const int kLoopCount = 50000; |
19 #else | 19 #else |
20 const int kLoopCount = 25000; | 20 const int kLoopCount = 25000; |
21 #endif | 21 #endif |
22 const int kScriptSize = 512 * KB; | 22 const int kScriptSize = 512 * KB; |
23 const int kNumFunctions = 1024; | 23 const int kNumFunctions = 1024; |
24 char scriptChars[kScriptSize]; | 24 char scriptChars[kScriptSize]; |
25 String& url = String::Handle(String::New("dart-test:FindCodeObject")); | 25 String& url = String::Handle(String::New("dart-test:FindCodeObject")); |
26 String& source = String::Handle(); | 26 String& source = String::Handle(); |
27 Script& script = Script::Handle(); | 27 Script& script = Script::Handle(); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 #else | 154 #else |
155 EXPECT(code.Size() > PageSpace::kPageSize); | 155 EXPECT(code.Size() > PageSpace::kPageSize); |
156 EXPECT(Code::LookupCode(pc) == code.raw()); | 156 EXPECT(Code::LookupCode(pc) == code.raw()); |
157 EXPECT(code.Size() > (1 * MB)); | 157 EXPECT(code.Size() > (1 * MB)); |
158 pc = code.EntryPoint() + (1 * MB); | 158 pc = code.EntryPoint() + (1 * MB); |
159 EXPECT(Code::LookupCode(pc) == code.raw()); | 159 EXPECT(Code::LookupCode(pc) == code.raw()); |
160 #endif // defined(TARGET_ARCH_MIPS) | 160 #endif // defined(TARGET_ARCH_MIPS) |
161 } | 161 } |
162 | 162 |
163 } // namespace dart | 163 } // namespace dart |
OLD | NEW |