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

Side by Side Diff: test/cctest/test-hashing.cc

Issue 1476763002: Make whether or not a Code object should be created by masm explicit (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: enum class FTW Created 5 years 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
« no previous file with comments | « test/cctest/test-disasm-arm64.cc ('k') | test/cctest/test-heap.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 #endif 106 #endif
107 } 107 }
108 108
109 109
110 void check(uint32_t key) { 110 void check(uint32_t key) {
111 Isolate* isolate = CcTest::i_isolate(); 111 Isolate* isolate = CcTest::i_isolate();
112 Factory* factory = isolate->factory(); 112 Factory* factory = isolate->factory();
113 HandleScope scope(isolate); 113 HandleScope scope(isolate);
114 114
115 v8::internal::byte buffer[2048]; 115 v8::internal::byte buffer[2048];
116 MacroAssembler masm(CcTest::i_isolate(), buffer, sizeof buffer); 116 MacroAssembler masm(CcTest::i_isolate(), buffer, sizeof(buffer),
117 v8::internal::CodeObjectRequired::kYes);
117 118
118 generate(&masm, key); 119 generate(&masm, key);
119 120
120 CodeDesc desc; 121 CodeDesc desc;
121 masm.GetCode(&desc); 122 masm.GetCode(&desc);
122 Handle<Object> undefined(isolate->heap()->undefined_value(), isolate); 123 Handle<Object> undefined(isolate->heap()->undefined_value(), isolate);
123 Handle<Code> code = factory->NewCode(desc, 124 Handle<Code> code = factory->NewCode(desc,
124 Code::ComputeFlags(Code::STUB), 125 Code::ComputeFlags(Code::STUB),
125 undefined); 126 undefined);
126 CHECK(code->IsCode()); 127 CHECK(code->IsCode());
(...skipping 29 matching lines...) Expand all
156 // Some pseudo-random numbers 157 // Some pseudo-random numbers
157 static const uint32_t kLimit = 1000; 158 static const uint32_t kLimit = 1000;
158 for (uint32_t i = 0; i < 5; i++) { 159 for (uint32_t i = 0; i < 5; i++) {
159 for (uint32_t j = 0; j < 5; j++) { 160 for (uint32_t j = 0; j < 5; j++) {
160 check(PseudoRandom(i, j) % kLimit); 161 check(PseudoRandom(i, j) % kLimit);
161 } 162 }
162 } 163 }
163 } 164 }
164 165
165 #undef __ 166 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-disasm-arm64.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698