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

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

Issue 778673002: Do not embed function in DirectLoadGlobalFunctionPrototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
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_ARM 7 #if V8_TARGET_ARCH_ARM
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 134
135 NameDictionaryLookupStub::GenerateNegativeLookup( 135 NameDictionaryLookupStub::GenerateNegativeLookup(
136 masm, miss_label, &done, receiver, properties, name, scratch1); 136 masm, miss_label, &done, receiver, properties, name, scratch1);
137 __ bind(&done); 137 __ bind(&done);
138 __ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1); 138 __ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
139 } 139 }
140 140
141 141
142 void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype( 142 void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype(
143 MacroAssembler* masm, int index, Register prototype, Label* miss) { 143 MacroAssembler* masm, int index, Register prototype, Register scratch,
144 Label* miss) {
144 Isolate* isolate = masm->isolate(); 145 Isolate* isolate = masm->isolate();
145 // Get the global function with the given index. 146 // Get the global function with the given index.
146 Handle<JSFunction> function( 147 Handle<JSFunction> jsfunction(
147 JSFunction::cast(isolate->native_context()->get(index))); 148 JSFunction::cast(isolate->native_context()->get(index)));
148 149 Handle<WeakCell> cell = isolate->factory()->NewWeakCell(jsfunction);
149 // Check we're still in the same context. 150 // Check we're still in the same context.
150 Register scratch = prototype; 151 Register function = prototype;
151 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX); 152 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX);
152 __ ldr(scratch, MemOperand(cp, offset)); 153 __ ldr(scratch, MemOperand(cp, offset));
153 __ ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); 154 __ ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset));
154 __ ldr(scratch, MemOperand(scratch, Context::SlotOffset(index))); 155 __ ldr(function, MemOperand(scratch, Context::SlotOffset(index)));
155 __ Move(ip, function); 156 __ CmpWeakValue(function, cell, scratch);
156 __ cmp(ip, scratch);
157 __ b(ne, miss); 157 __ b(ne, miss);
158
159 // Load its initial map. The global functions all have initial maps. 158 // Load its initial map. The global functions all have initial maps.
160 __ Move(prototype, Handle<Map>(function->initial_map())); 159 __ ldr(scratch,
160 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
161 // Load the prototype from the initial map. 161 // Load the prototype from the initial map.
162 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); 162 __ ldr(prototype, FieldMemOperand(scratch, Map::kPrototypeOffset));
163 } 163 }
164 164
165 165
166 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype( 166 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(
167 MacroAssembler* masm, Register receiver, Register scratch1, 167 MacroAssembler* masm, Register receiver, Register scratch1,
168 Register scratch2, Label* miss_label) { 168 Register scratch2, Label* miss_label) {
169 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); 169 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
170 __ mov(r0, scratch1); 170 __ mov(r0, scratch1);
171 __ Ret(); 171 __ Ret();
172 } 172 }
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 // Return the generated code. 682 // Return the generated code.
683 return GetCode(kind(), Code::NORMAL, name); 683 return GetCode(kind(), Code::NORMAL, name);
684 } 684 }
685 685
686 686
687 #undef __ 687 #undef __
688 } 688 }
689 } // namespace v8::internal 689 } // namespace v8::internal
690 690
691 #endif // V8_TARGET_ARCH_ARM 691 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ic/arm64/handler-compiler-arm64.cc » ('j') | src/ic/arm64/handler-compiler-arm64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698