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

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: updates 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
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), true);
117 117
118 generate(&masm, key); 118 generate(&masm, key);
119 119
120 CodeDesc desc; 120 CodeDesc desc;
121 masm.GetCode(&desc); 121 masm.GetCode(&desc);
122 Handle<Object> undefined(isolate->heap()->undefined_value(), isolate); 122 Handle<Object> undefined(isolate->heap()->undefined_value(), isolate);
123 Handle<Code> code = factory->NewCode(desc, 123 Handle<Code> code = factory->NewCode(desc,
124 Code::ComputeFlags(Code::STUB), 124 Code::ComputeFlags(Code::STUB),
125 undefined); 125 undefined);
126 CHECK(code->IsCode()); 126 CHECK(code->IsCode());
(...skipping 29 matching lines...) Expand all
156 // Some pseudo-random numbers 156 // Some pseudo-random numbers
157 static const uint32_t kLimit = 1000; 157 static const uint32_t kLimit = 1000;
158 for (uint32_t i = 0; i < 5; i++) { 158 for (uint32_t i = 0; i < 5; i++) {
159 for (uint32_t j = 0; j < 5; j++) { 159 for (uint32_t j = 0; j < 5; j++) {
160 check(PseudoRandom(i, j) % kLimit); 160 check(PseudoRandom(i, j) % kLimit);
161 } 161 }
162 } 162 }
163 } 163 }
164 164
165 #undef __ 165 #undef __
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698