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

Side by Side Diff: test/cctest/test-heap.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-hashing.cc ('k') | test/cctest/test-macro-assembler-arm.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 4928 matching lines...) Expand 10 before | Expand all | Expand 10 after
4939 } 4939 }
4940 heap->CollectAllAvailableGarbage(); 4940 heap->CollectAllAvailableGarbage();
4941 // Now mortal code should be dead. 4941 // Now mortal code should be dead.
4942 code_chain_length_after = GetCodeChainLength(*code); 4942 code_chain_length_after = GetCodeChainLength(*code);
4943 CHECK_EQ(code_chain_length_before - 1, code_chain_length_after); 4943 CHECK_EQ(code_chain_length_before - 1, code_chain_length_after);
4944 } 4944 }
4945 4945
4946 4946
4947 static Handle<Code> DummyOptimizedCode(Isolate* isolate) { 4947 static Handle<Code> DummyOptimizedCode(Isolate* isolate) {
4948 i::byte buffer[i::Assembler::kMinimalBufferSize]; 4948 i::byte buffer[i::Assembler::kMinimalBufferSize];
4949 MacroAssembler masm(isolate, buffer, sizeof(buffer)); 4949 MacroAssembler masm(isolate, buffer, sizeof(buffer),
4950 v8::internal::CodeObjectRequired::kYes);
4950 CodeDesc desc; 4951 CodeDesc desc;
4951 masm.Push(isolate->factory()->undefined_value()); 4952 masm.Push(isolate->factory()->undefined_value());
4952 masm.Drop(1); 4953 masm.Drop(1);
4953 masm.GetCode(&desc); 4954 masm.GetCode(&desc);
4954 Handle<Object> undefined(isolate->heap()->undefined_value(), isolate); 4955 Handle<Object> undefined(isolate->heap()->undefined_value(), isolate);
4955 Handle<Code> code = isolate->factory()->NewCode( 4956 Handle<Code> code = isolate->factory()->NewCode(
4956 desc, Code::ComputeFlags(Code::OPTIMIZED_FUNCTION), undefined); 4957 desc, Code::ComputeFlags(Code::OPTIMIZED_FUNCTION), undefined);
4957 CHECK(code->IsCode()); 4958 CHECK(code->IsCode());
4958 return code; 4959 return code;
4959 } 4960 }
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
6449 isolate->IncrementJsCallsFromApiCounter(); 6450 isolate->IncrementJsCallsFromApiCounter();
6450 isolate->IncrementJsCallsFromApiCounter(); 6451 isolate->IncrementJsCallsFromApiCounter();
6451 isolate->IncrementJsCallsFromApiCounter(); 6452 isolate->IncrementJsCallsFromApiCounter();
6452 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); 6453 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4);
6453 CheckDoubleEquals(2, calls_per_ms); 6454 CheckDoubleEquals(2, calls_per_ms);
6454 } 6455 }
6455 6456
6456 6457
6457 } // namespace internal 6458 } // namespace internal
6458 } // namespace v8 6459 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/test-hashing.cc ('k') | test/cctest/test-macro-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698