| OLD | NEW |
| 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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 Cmp(current_object, empty_fixed_array_value); | 972 Cmp(current_object, empty_fixed_array_value); |
| 973 B(ne, call_runtime); | 973 B(ne, call_runtime); |
| 974 | 974 |
| 975 Ldr(current_object, FieldMemOperand(map, Map::kPrototypeOffset)); | 975 Ldr(current_object, FieldMemOperand(map, Map::kPrototypeOffset)); |
| 976 Cmp(current_object, null_value); | 976 Cmp(current_object, null_value); |
| 977 B(ne, &next); | 977 B(ne, &next); |
| 978 } | 978 } |
| 979 | 979 |
| 980 | 980 |
| 981 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, | 981 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, |
| 982 Register scratch1, | 982 Register scratch1, |
| 983 Register scratch2) { | 983 Register scratch2, |
| 984 Label no_memento_available; | 984 Label* no_memento_found) { |
| 985 ExternalReference new_space_start = | 985 ExternalReference new_space_start = |
| 986 ExternalReference::new_space_start(isolate()); | 986 ExternalReference::new_space_start(isolate()); |
| 987 ExternalReference new_space_allocation_top = | 987 ExternalReference new_space_allocation_top = |
| 988 ExternalReference::new_space_allocation_top_address(isolate()); | 988 ExternalReference::new_space_allocation_top_address(isolate()); |
| 989 | 989 |
| 990 Add(scratch1, receiver, | 990 Add(scratch1, receiver, |
| 991 JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag); | 991 JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag); |
| 992 Cmp(scratch1, Operand(new_space_start)); | 992 Cmp(scratch1, Operand(new_space_start)); |
| 993 B(lt, &no_memento_available); | 993 B(lt, no_memento_found); |
| 994 | 994 |
| 995 Mov(scratch2, Operand(new_space_allocation_top)); | 995 Mov(scratch2, Operand(new_space_allocation_top)); |
| 996 Ldr(scratch2, MemOperand(scratch2)); | 996 Ldr(scratch2, MemOperand(scratch2)); |
| 997 Cmp(scratch1, scratch2); | 997 Cmp(scratch1, scratch2); |
| 998 B(gt, &no_memento_available); | 998 B(gt, no_memento_found); |
| 999 | 999 |
| 1000 Ldr(scratch1, MemOperand(scratch1, -AllocationMemento::kSize)); | 1000 Ldr(scratch1, MemOperand(scratch1, -AllocationMemento::kSize)); |
| 1001 Cmp(scratch1, | 1001 Cmp(scratch1, |
| 1002 Operand(isolate()->factory()->allocation_memento_map())); | 1002 Operand(isolate()->factory()->allocation_memento_map())); |
| 1003 | |
| 1004 Bind(&no_memento_available); | |
| 1005 } | 1003 } |
| 1006 | 1004 |
| 1007 | 1005 |
| 1008 void MacroAssembler::JumpToHandlerEntry(Register exception, | 1006 void MacroAssembler::JumpToHandlerEntry(Register exception, |
| 1009 Register object, | 1007 Register object, |
| 1010 Register state, | 1008 Register state, |
| 1011 Register scratch1, | 1009 Register scratch1, |
| 1012 Register scratch2) { | 1010 Register scratch2) { |
| 1013 // Handler expects argument in x0. | 1011 // Handler expects argument in x0. |
| 1014 ASSERT(exception.Is(x0)); | 1012 ASSERT(exception.Is(x0)); |
| (...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2430 const CallWrapper& call_wrapper, | 2428 const CallWrapper& call_wrapper, |
| 2431 CallKind call_kind, | 2429 CallKind call_kind, |
| 2432 Register function_reg) { | 2430 Register function_reg) { |
| 2433 // You can't call a function without a valid frame. | 2431 // You can't call a function without a valid frame. |
| 2434 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 2432 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
| 2435 | 2433 |
| 2436 // Load the function object, if it isn't already loaded. | 2434 // Load the function object, if it isn't already loaded. |
| 2437 ASSERT(function_reg.Is(x1) || function_reg.IsNone()); | 2435 ASSERT(function_reg.Is(x1) || function_reg.IsNone()); |
| 2438 if (function_reg.IsNone()) { | 2436 if (function_reg.IsNone()) { |
| 2439 function_reg = x1; | 2437 function_reg = x1; |
| 2440 LoadHeapObject(function_reg, function); | 2438 LoadObject(function_reg, function); |
| 2441 } | 2439 } |
| 2442 | 2440 |
| 2443 Register code_reg = x3; | 2441 Register code_reg = x3; |
| 2444 | 2442 |
| 2445 // Set up the context. | 2443 // Set up the context. |
| 2446 Ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); | 2444 Ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); |
| 2447 | 2445 |
| 2448 // We call indirectly through the code field in the function to | 2446 // We call indirectly through the code field in the function to |
| 2449 // allow recompilation to take effect without changing any of the | 2447 // allow recompilation to take effect without changing any of the |
| 2450 // call sites. | 2448 // call sites. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2555 JumpIfHeapNumber(heap_number, &ok); | 2553 JumpIfHeapNumber(heap_number, &ok); |
| 2556 Abort(kExpectedHeapNumber); | 2554 Abort(kExpectedHeapNumber); |
| 2557 Bind(&ok); | 2555 Bind(&ok); |
| 2558 } | 2556 } |
| 2559 | 2557 |
| 2560 Ldr(double_scratch, FieldMemOperand(heap_number, HeapNumber::kValueOffset)); | 2558 Ldr(double_scratch, FieldMemOperand(heap_number, HeapNumber::kValueOffset)); |
| 2561 ECMA262ToInt32(result, double_scratch, scratch1, scratch2, format); | 2559 ECMA262ToInt32(result, double_scratch, scratch1, scratch2, format); |
| 2562 } | 2560 } |
| 2563 | 2561 |
| 2564 | 2562 |
| 2563 void MacroAssembler::Prologue(PrologueFrameMode frame_mode) { |
| 2564 if (frame_mode == BUILD_STUB_FRAME) { |
| 2565 ASSERT(StackPointer().Is(jssp)); |
| 2566 // TODO(jbramley): Does x1 contain a JSFunction here, or does it already |
| 2567 // have the special STUB smi? |
| 2568 __ Mov(Tmp0(), Operand(Smi::FromInt(StackFrame::STUB))); |
| 2569 // Compiled stubs don't age, and so they don't need the predictable code |
| 2570 // ageing sequence. |
| 2571 __ Push(lr, fp, cp, Tmp0()); |
| 2572 __ Add(fp, jssp, 2 * kPointerSize); |
| 2573 } else { |
| 2574 TODO_UNIMPLEMENTED("Prologue: Implement FLAG_optimize_for_size."); |
| 2575 __ EmitFrameSetupForCodeAgePatching(); |
| 2576 } |
| 2577 } |
| 2578 |
| 2579 |
| 2565 void MacroAssembler::EnterFrame(StackFrame::Type type) { | 2580 void MacroAssembler::EnterFrame(StackFrame::Type type) { |
| 2566 ASSERT(jssp.Is(StackPointer())); | 2581 ASSERT(jssp.Is(StackPointer())); |
| 2567 Push(lr, fp, cp); | 2582 Push(lr, fp, cp); |
| 2568 Mov(Tmp1(), Operand(Smi::FromInt(type))); | 2583 Mov(Tmp1(), Operand(Smi::FromInt(type))); |
| 2569 Mov(Tmp0(), Operand(CodeObject())); | 2584 Mov(Tmp0(), Operand(CodeObject())); |
| 2570 Push(Tmp1(), Tmp0()); | 2585 Push(Tmp1(), Tmp0()); |
| 2571 // jssp[4] : lr | 2586 // jssp[4] : lr |
| 2572 // jssp[3] : fp | 2587 // jssp[3] : fp |
| 2573 // jssp[2] : cp | 2588 // jssp[2] : cp |
| 2574 // jssp[1] : type | 2589 // jssp[1] : type |
| (...skipping 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4697 } | 4712 } |
| 4698 } | 4713 } |
| 4699 | 4714 |
| 4700 | 4715 |
| 4701 #undef __ | 4716 #undef __ |
| 4702 | 4717 |
| 4703 | 4718 |
| 4704 } } // namespace v8::internal | 4719 } } // namespace v8::internal |
| 4705 | 4720 |
| 4706 #endif // V8_TARGET_ARCH_A64 | 4721 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |