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

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

Issue 8509031: Revert r1380 that is breaking frog. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month 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/code_generator_ia32_test.cc ('k') | runtime/vm/dart_api_impl.cc » ('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/code_index_table.h" 5 #include "vm/code_index_table.h"
6 6
7 #include "vm/assert.h" 7 #include "vm/assert.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 (kScriptSize - written), 45 (kScriptSize - written),
46 "%s", 46 "%s",
47 buffer); 47 buffer);
48 } 48 }
49 OS::SNPrint((scriptChars + written), (kScriptSize - written), "}"); 49 OS::SNPrint((scriptChars + written), (kScriptSize - written), "}");
50 source = String::New(scriptChars); 50 source = String::New(scriptChars);
51 script = Script::New(url, source, RawScript::kSource); 51 script = Script::New(url, source, RawScript::kSource);
52 EXPECT(CompilerTest::TestCompileScript(lib, script)); 52 EXPECT(CompilerTest::TestCompileScript(lib, script));
53 clsA = lib.LookupClass(String::Handle(String::NewSymbol("A"))); 53 clsA = lib.LookupClass(String::Handle(String::NewSymbol("A")));
54 EXPECT(!clsA.IsNull()); 54 EXPECT(!clsA.IsNull());
55 ClassFinalizer::FinalizeAllClasses(); 55 ClassFinalizer::FinalizePendingClasses();
56 for (int i = 0; i < kNumFunctions; i++) { 56 for (int i = 0; i < kNumFunctions; i++) {
57 OS::SNPrint(buffer, 256, "foo%d", i); 57 OS::SNPrint(buffer, 256, "foo%d", i);
58 function_name = String::New(buffer); 58 function_name = String::New(buffer);
59 function = clsA.LookupStaticFunction(function_name); 59 function = clsA.LookupStaticFunction(function_name);
60 EXPECT(!function.IsNull()); 60 EXPECT(!function.IsNull());
61 EXPECT(CompilerTest::TestCompileFunction(function)); 61 EXPECT(CompilerTest::TestCompileFunction(function));
62 EXPECT(function.HasCode()); 62 EXPECT(function.HasCode());
63 } 63 }
64 64
65 // Now load up class B with 1024 functions. 65 // Now load up class B with 1024 functions.
(...skipping 30 matching lines...) Expand all
96 "%s", 96 "%s",
97 buffer); 97 buffer);
98 } 98 }
99 OS::SNPrint((scriptChars + written), (kScriptSize - written), "}"); 99 OS::SNPrint((scriptChars + written), (kScriptSize - written), "}");
100 url = String::New("dart-test:CodeIndexTable"); 100 url = String::New("dart-test:CodeIndexTable");
101 source = String::New(scriptChars); 101 source = String::New(scriptChars);
102 script = Script::New(url, source, RawScript::kSource); 102 script = Script::New(url, source, RawScript::kSource);
103 EXPECT(CompilerTest::TestCompileScript(lib, script)); 103 EXPECT(CompilerTest::TestCompileScript(lib, script));
104 clsB = lib.LookupClass(String::Handle(String::NewSymbol("B"))); 104 clsB = lib.LookupClass(String::Handle(String::NewSymbol("B")));
105 EXPECT(!clsB.IsNull()); 105 EXPECT(!clsB.IsNull());
106 ClassFinalizer::FinalizeAllClasses(); 106 ClassFinalizer::FinalizePendingClasses();
107 for (int i = 0; i < kNumFunctions; i++) { 107 for (int i = 0; i < kNumFunctions; i++) {
108 OS::SNPrint(buffer, 256, "moo%d", i); 108 OS::SNPrint(buffer, 256, "moo%d", i);
109 function_name = String::New(buffer); 109 function_name = String::New(buffer);
110 function = clsB.LookupStaticFunction(function_name); 110 function = clsB.LookupStaticFunction(function_name);
111 EXPECT(!function.IsNull()); 111 EXPECT(!function.IsNull());
112 EXPECT(CompilerTest::TestCompileFunction(function)); 112 EXPECT(CompilerTest::TestCompileFunction(function));
113 EXPECT(function.HasCode()); 113 EXPECT(function.HasCode());
114 } 114 }
115 115
116 // Now try and access these functions using the code index table. 116 // Now try and access these functions using the code index table.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 EXPECT(code_index_table->LookupCode(pc) == code.raw()); 148 EXPECT(code_index_table->LookupCode(pc) == code.raw());
149 EXPECT(code.Size() > 750 * KB); 149 EXPECT(code.Size() > 750 * KB);
150 pc = code.EntryPoint() + 750 * KB; 150 pc = code.EntryPoint() + 750 * KB;
151 EXPECT(code_index_table->LookupFunction(pc) == function.raw()); 151 EXPECT(code_index_table->LookupFunction(pc) == function.raw());
152 EXPECT(code_index_table->LookupCode(pc) == code.raw()); 152 EXPECT(code_index_table->LookupCode(pc) == code.raw());
153 } 153 }
154 154
155 #endif // TARGET_ARCH_IA32 155 #endif // TARGET_ARCH_IA32
156 156
157 } // namespace dart 157 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator_ia32_test.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698