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

Side by Side Diff: src/ic/mips64/handler-compiler-mips64.cc

Issue 877243004: Load callback data from weak cell instead of embedding it in handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/x64/handler-compiler-x64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/ic/call-optimization.h" 9 #include "src/ic/call-optimization.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); 553 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1);
554 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); 554 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2);
555 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); 555 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3);
556 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); 556 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4);
557 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); 557 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5);
558 STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6); 558 STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6);
559 DCHECK(!scratch2().is(reg)); 559 DCHECK(!scratch2().is(reg));
560 DCHECK(!scratch3().is(reg)); 560 DCHECK(!scratch3().is(reg));
561 DCHECK(!scratch4().is(reg)); 561 DCHECK(!scratch4().is(reg));
562 __ push(receiver()); 562 __ push(receiver());
563 if (heap()->InNewSpace(callback->data())) { 563 Handle<Object> data(callback->data(), isolate());
564 __ li(scratch3(), callback); 564 if (data->IsUndefined() || data->IsSmi()) {
565 __ ld(scratch3(), 565 __ li(scratch3(), data);
566 FieldMemOperand(scratch3(), ExecutableAccessorInfo::kDataOffset));
567 } else { 566 } else {
568 __ li(scratch3(), Handle<Object>(callback->data(), isolate())); 567 Handle<WeakCell> cell =
568 isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data));
569 // The callback is alive if this instruction is executed,
570 // so the weak cell is not cleared and points to data.
571 __ GetWeakValue(scratch3(), cell);
569 } 572 }
570 __ Dsubu(sp, sp, 6 * kPointerSize); 573 __ Dsubu(sp, sp, 6 * kPointerSize);
571 __ sd(scratch3(), MemOperand(sp, 5 * kPointerSize)); 574 __ sd(scratch3(), MemOperand(sp, 5 * kPointerSize));
572 __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex); 575 __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex);
573 __ sd(scratch3(), MemOperand(sp, 4 * kPointerSize)); 576 __ sd(scratch3(), MemOperand(sp, 4 * kPointerSize));
574 __ sd(scratch3(), MemOperand(sp, 3 * kPointerSize)); 577 __ sd(scratch3(), MemOperand(sp, 3 * kPointerSize));
575 __ li(scratch4(), Operand(ExternalReference::isolate_address(isolate()))); 578 __ li(scratch4(), Operand(ExternalReference::isolate_address(isolate())));
576 __ sd(scratch4(), MemOperand(sp, 2 * kPointerSize)); 579 __ sd(scratch4(), MemOperand(sp, 2 * kPointerSize));
577 __ sd(reg, MemOperand(sp, 1 * kPointerSize)); 580 __ sd(reg, MemOperand(sp, 1 * kPointerSize));
578 __ sd(name(), MemOperand(sp, 0 * kPointerSize)); 581 __ sd(name(), MemOperand(sp, 0 * kPointerSize));
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 // Return the generated code. 743 // Return the generated code.
741 return GetCode(kind(), Code::NORMAL, name); 744 return GetCode(kind(), Code::NORMAL, name);
742 } 745 }
743 746
744 747
745 #undef __ 748 #undef __
746 } 749 }
747 } // namespace v8::internal 750 } // namespace v8::internal
748 751
749 #endif // V8_TARGET_ARCH_MIPS64 752 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698