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

Side by Side Diff: test/cctest/test-macro-assembler-mips.cc

Issue 1457223005: Remove a bunch of Isolate::Current() callsites from simulators (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 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
« no previous file with comments | « test/cctest/test-macro-assembler-arm.cc ('k') | test/cctest/test-macro-assembler-mips64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 src_buffer[i] = to_non_zero(i); 109 src_buffer[i] = to_non_zero(i);
110 } 110 }
111 111
112 const int fuzz = 11; 112 const int fuzz = 11;
113 113
114 for (int size = 0; size < 600; size++) { 114 for (int size = 0; size < 600; size++) {
115 for (const byte* src = src_buffer; src < src_buffer + fuzz; src++) { 115 for (const byte* src = src_buffer; src < src_buffer + fuzz; src++) {
116 for (byte* dest = dest_buffer; dest < dest_buffer + fuzz; dest++) { 116 for (byte* dest = dest_buffer; dest < dest_buffer + fuzz; dest++) {
117 memset(dest_buffer, 0, data_size); 117 memset(dest_buffer, 0, data_size);
118 CHECK(dest + size < dest_buffer + data_size); 118 CHECK(dest + size < dest_buffer + data_size);
119 (void) CALL_GENERATED_CODE(f, reinterpret_cast<int>(src), 119 (void)CALL_GENERATED_CODE(isolate, f, reinterpret_cast<int>(src),
120 reinterpret_cast<int>(dest), size, 0, 0); 120 reinterpret_cast<int>(dest), size, 0, 0);
121 // a0 and a1 should point at the first byte after the copied data. 121 // a0 and a1 should point at the first byte after the copied data.
122 CHECK_EQ(src + size, a0_); 122 CHECK_EQ(src + size, a0_);
123 CHECK_EQ(dest + size, a1_); 123 CHECK_EQ(dest + size, a1_);
124 // Check that we haven't written outside the target area. 124 // Check that we haven't written outside the target area.
125 CHECK(all_zeroes(dest_buffer, dest)); 125 CHECK(all_zeroes(dest_buffer, dest));
126 CHECK(all_zeroes(dest + size, dest_buffer + data_size)); 126 CHECK(all_zeroes(dest + size, dest_buffer + data_size));
127 // Check the target area. 127 // Check the target area.
128 CHECK_EQ(0, memcmp(src, dest, size)); 128 CHECK_EQ(0, memcmp(src, dest, size));
129 } 129 }
130 } 130 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 CodeDesc desc; 248 CodeDesc desc;
249 masm->GetCode(&desc); 249 masm->GetCode(&desc);
250 Handle<Code> code = isolate->factory()->NewCode( 250 Handle<Code> code = isolate->factory()->NewCode(
251 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 251 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
252 #ifdef OBJECT_PRINT 252 #ifdef OBJECT_PRINT
253 code->Print(std::cout); 253 code->Print(std::cout);
254 #endif 254 #endif
255 F1 f = FUNCTION_CAST<F1>(code->entry()); 255 F1 f = FUNCTION_CAST<F1>(code->entry());
256 for (int i = 0; i < kNumCases; ++i) { 256 for (int i = 0; i < kNumCases; ++i) {
257 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0)); 257 int res =
258 reinterpret_cast<int>(CALL_GENERATED_CODE(isolate, f, i, 0, 0, 0, 0));
258 ::printf("f(%d) = %d\n", i, res); 259 ::printf("f(%d) = %d\n", i, res);
259 CHECK_EQ(values[i], res); 260 CHECK_EQ(values[i], res);
260 } 261 }
261 } 262 }
262 263
263 264
264 #undef __ 265 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-macro-assembler-arm.cc ('k') | test/cctest/test-macro-assembler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698