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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 69953023: Add ability to disable inline bump-pointer allocation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/spaces.cc ('k') | test/cctest/cctest.h » ('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 4063 matching lines...) Expand 10 before | Expand all | Expand 10 after
4074 4074
4075 4075
4076 void MacroAssembler::Allocate(int object_size, 4076 void MacroAssembler::Allocate(int object_size,
4077 Register result, 4077 Register result,
4078 Register result_end, 4078 Register result_end,
4079 Register scratch, 4079 Register scratch,
4080 Label* gc_required, 4080 Label* gc_required,
4081 AllocationFlags flags) { 4081 AllocationFlags flags) {
4082 ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0); 4082 ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0);
4083 ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize); 4083 ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize);
4084 if (!FLAG_inline_new || 4084 if (!FLAG_inline_new) {
4085 // TODO(mstarzinger): Implement more efficiently by keeping then
4086 // bump-pointer allocation area empty instead of recompiling code.
4087 isolate()->heap_profiler()->is_tracking_allocations()) {
4088 if (emit_debug_code()) { 4085 if (emit_debug_code()) {
4089 // Trash the registers to simulate an allocation failure. 4086 // Trash the registers to simulate an allocation failure.
4090 movl(result, Immediate(0x7091)); 4087 movl(result, Immediate(0x7091));
4091 if (result_end.is_valid()) { 4088 if (result_end.is_valid()) {
4092 movl(result_end, Immediate(0x7191)); 4089 movl(result_end, Immediate(0x7191));
4093 } 4090 }
4094 if (scratch.is_valid()) { 4091 if (scratch.is_valid()) {
4095 movl(scratch, Immediate(0x7291)); 4092 movl(scratch, Immediate(0x7291));
4096 } 4093 }
4097 } 4094 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
4157 } 4154 }
4158 4155
4159 4156
4160 void MacroAssembler::Allocate(Register object_size, 4157 void MacroAssembler::Allocate(Register object_size,
4161 Register result, 4158 Register result,
4162 Register result_end, 4159 Register result_end,
4163 Register scratch, 4160 Register scratch,
4164 Label* gc_required, 4161 Label* gc_required,
4165 AllocationFlags flags) { 4162 AllocationFlags flags) {
4166 ASSERT((flags & SIZE_IN_WORDS) == 0); 4163 ASSERT((flags & SIZE_IN_WORDS) == 0);
4167 if (!FLAG_inline_new || 4164 if (!FLAG_inline_new) {
4168 // TODO(mstarzinger): Implement more efficiently by keeping then
4169 // bump-pointer allocation area empty instead of recompiling code.
4170 isolate()->heap_profiler()->is_tracking_allocations()) {
4171 if (emit_debug_code()) { 4165 if (emit_debug_code()) {
4172 // Trash the registers to simulate an allocation failure. 4166 // Trash the registers to simulate an allocation failure.
4173 movl(result, Immediate(0x7091)); 4167 movl(result, Immediate(0x7091));
4174 movl(result_end, Immediate(0x7191)); 4168 movl(result_end, Immediate(0x7191));
4175 if (scratch.is_valid()) { 4169 if (scratch.is_valid()) {
4176 movl(scratch, Immediate(0x7291)); 4170 movl(scratch, Immediate(0x7291));
4177 } 4171 }
4178 // object_size is left unchanged by this function. 4172 // object_size is left unchanged by this function.
4179 } 4173 }
4180 jmp(gc_required); 4174 jmp(gc_required);
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
4989 j(equal, found); 4983 j(equal, found);
4990 movq(current, FieldOperand(current, Map::kPrototypeOffset)); 4984 movq(current, FieldOperand(current, Map::kPrototypeOffset));
4991 CompareRoot(current, Heap::kNullValueRootIndex); 4985 CompareRoot(current, Heap::kNullValueRootIndex);
4992 j(not_equal, &loop_again); 4986 j(not_equal, &loop_again);
4993 } 4987 }
4994 4988
4995 4989
4996 } } // namespace v8::internal 4990 } } // namespace v8::internal
4997 4991
4998 #endif // V8_TARGET_ARCH_X64 4992 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/spaces.cc ('k') | test/cctest/cctest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698