OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |