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

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

Issue 141363005: A64: Synchronize with r15204. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months 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/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.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 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 lea(esi, Operand(esp, (argc + 1) * kPointerSize)); 1966 lea(esi, Operand(esp, (argc + 1) * kPointerSize));
1967 mov(Operand(esp, 0 * kPointerSize), esi); 1967 mov(Operand(esp, 0 * kPointerSize), esi);
1968 if (emit_debug_code()) { 1968 if (emit_debug_code()) {
1969 mov(Operand(esi, 0), Immediate(0)); 1969 mov(Operand(esi, 0), Immediate(0));
1970 } 1970 }
1971 } 1971 }
1972 } 1972 }
1973 1973
1974 1974
1975 void MacroAssembler::CallApiFunctionAndReturn(Address function_address, 1975 void MacroAssembler::CallApiFunctionAndReturn(Address function_address,
1976 Address thunk_address,
1977 Operand thunk_last_arg,
1976 int stack_space, 1978 int stack_space,
1977 bool returns_handle, 1979 bool returns_handle,
1978 int return_value_offset) { 1980 int return_value_offset) {
1979 ExternalReference next_address = 1981 ExternalReference next_address =
1980 ExternalReference::handle_scope_next_address(isolate()); 1982 ExternalReference::handle_scope_next_address(isolate());
1981 ExternalReference limit_address = 1983 ExternalReference limit_address =
1982 ExternalReference::handle_scope_limit_address(isolate()); 1984 ExternalReference::handle_scope_limit_address(isolate());
1983 ExternalReference level_address = 1985 ExternalReference level_address =
1984 ExternalReference::handle_scope_level_address(isolate()); 1986 ExternalReference::handle_scope_level_address(isolate());
1985 1987
1986 // Allocate HandleScope in callee-save registers. 1988 // Allocate HandleScope in callee-save registers.
1987 mov(ebx, Operand::StaticVariable(next_address)); 1989 mov(ebx, Operand::StaticVariable(next_address));
1988 mov(edi, Operand::StaticVariable(limit_address)); 1990 mov(edi, Operand::StaticVariable(limit_address));
1989 add(Operand::StaticVariable(level_address), Immediate(1)); 1991 add(Operand::StaticVariable(level_address), Immediate(1));
1990 1992
1991 if (FLAG_log_timer_events) { 1993 if (FLAG_log_timer_events) {
1992 FrameScope frame(this, StackFrame::MANUAL); 1994 FrameScope frame(this, StackFrame::MANUAL);
1993 PushSafepointRegisters(); 1995 PushSafepointRegisters();
1994 PrepareCallCFunction(1, eax); 1996 PrepareCallCFunction(1, eax);
1995 mov(Operand(esp, 0), 1997 mov(Operand(esp, 0),
1996 Immediate(ExternalReference::isolate_address(isolate()))); 1998 Immediate(ExternalReference::isolate_address(isolate())));
1997 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); 1999 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1);
1998 PopSafepointRegisters(); 2000 PopSafepointRegisters();
1999 } 2001 }
2000 2002
2003
2004 Label profiler_disabled;
2005 Label end_profiler_check;
2006 bool* is_profiling_flag =
2007 isolate()->cpu_profiler()->is_profiling_address();
2008 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1);
2009 mov(eax, Immediate(reinterpret_cast<Address>(is_profiling_flag)));
2010 cmpb(Operand(eax, 0), 0);
2011 j(zero, &profiler_disabled);
2012
2013 // Additional parameter is the address of the actual getter function.
2014 mov(thunk_last_arg, Immediate(function_address));
2015 // Call the api function.
2016 call(thunk_address, RelocInfo::RUNTIME_ENTRY);
2017 jmp(&end_profiler_check);
2018
2019 bind(&profiler_disabled);
2001 // Call the api function. 2020 // Call the api function.
2002 call(function_address, RelocInfo::RUNTIME_ENTRY); 2021 call(function_address, RelocInfo::RUNTIME_ENTRY);
2022 bind(&end_profiler_check);
2003 2023
2004 if (FLAG_log_timer_events) { 2024 if (FLAG_log_timer_events) {
2005 FrameScope frame(this, StackFrame::MANUAL); 2025 FrameScope frame(this, StackFrame::MANUAL);
2006 PushSafepointRegisters(); 2026 PushSafepointRegisters();
2007 PrepareCallCFunction(1, eax); 2027 PrepareCallCFunction(1, eax);
2008 mov(Operand(esp, 0), 2028 mov(Operand(esp, 0),
2009 Immediate(ExternalReference::isolate_address(isolate()))); 2029 Immediate(ExternalReference::isolate_address(isolate())));
2010 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); 2030 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1);
2011 PopSafepointRegisters(); 2031 PopSafepointRegisters();
2012 } 2032 }
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 // the stack pointer. 2508 // the stack pointer.
2489 ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters); 2509 ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters);
2490 return kNumSafepointRegisters - reg_code - 1; 2510 return kNumSafepointRegisters - reg_code - 1;
2491 } 2511 }
2492 2512
2493 2513
2494 void MacroAssembler::LoadHeapObject(Register result, 2514 void MacroAssembler::LoadHeapObject(Register result,
2495 Handle<HeapObject> object) { 2515 Handle<HeapObject> object) {
2496 AllowDeferredHandleDereference embedding_raw_address; 2516 AllowDeferredHandleDereference embedding_raw_address;
2497 if (isolate()->heap()->InNewSpace(*object)) { 2517 if (isolate()->heap()->InNewSpace(*object)) {
2498 Handle<JSGlobalPropertyCell> cell = 2518 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2499 isolate()->factory()->NewJSGlobalPropertyCell(object); 2519 mov(result, Operand::ForCell(cell));
2500 mov(result, Operand::Cell(cell));
2501 } else { 2520 } else {
2502 mov(result, object); 2521 mov(result, object);
2503 } 2522 }
2504 } 2523 }
2505 2524
2506 2525
2507 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) { 2526 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) {
2508 AllowDeferredHandleDereference using_raw_address; 2527 AllowDeferredHandleDereference using_raw_address;
2509 if (isolate()->heap()->InNewSpace(*object)) { 2528 if (isolate()->heap()->InNewSpace(*object)) {
2510 Handle<JSGlobalPropertyCell> cell = 2529 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2511 isolate()->factory()->NewJSGlobalPropertyCell(object); 2530 cmp(reg, Operand::ForCell(cell));
2512 cmp(reg, Operand::Cell(cell));
2513 } else { 2531 } else {
2514 cmp(reg, object); 2532 cmp(reg, object);
2515 } 2533 }
2516 } 2534 }
2517 2535
2518 2536
2519 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { 2537 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) {
2520 AllowDeferredHandleDereference using_raw_address; 2538 AllowDeferredHandleDereference using_raw_address;
2521 if (isolate()->heap()->InNewSpace(*object)) { 2539 if (isolate()->heap()->InNewSpace(*object)) {
2522 Handle<JSGlobalPropertyCell> cell = 2540 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2523 isolate()->factory()->NewJSGlobalPropertyCell(object); 2541 push(Operand::ForCell(cell));
2524 push(Operand::Cell(cell));
2525 } else { 2542 } else {
2526 Push(object); 2543 Push(object);
2527 } 2544 }
2528 } 2545 }
2529 2546
2530 2547
2531 void MacroAssembler::Ret() { 2548 void MacroAssembler::Ret() {
2532 ret(0); 2549 ret(0);
2533 } 2550 }
2534 2551
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
3151 j(greater, &no_info_available); 3168 j(greater, &no_info_available);
3152 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), 3169 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize),
3153 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); 3170 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map())));
3154 bind(&no_info_available); 3171 bind(&no_info_available);
3155 } 3172 }
3156 3173
3157 3174
3158 } } // namespace v8::internal 3175 } } // namespace v8::internal
3159 3176
3160 #endif // V8_TARGET_ARCH_IA32 3177 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698