OLD | NEW |
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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 __ Ret(); | 278 __ Ret(); |
279 } | 279 } |
280 | 280 |
281 | 281 |
282 void ElementHandlerCompiler::GenerateLoadDictionaryElement( | 282 void ElementHandlerCompiler::GenerateLoadDictionaryElement( |
283 MacroAssembler* masm) { | 283 MacroAssembler* masm) { |
284 // The return address is in lr. | 284 // The return address is in lr. |
285 Label slow, miss; | 285 Label slow, miss; |
286 | 286 |
287 Register result = x0; | 287 Register result = x0; |
288 Register key = LoadIC::NameRegister(); | 288 Register key = LoadConvention::NameRegister(); |
289 Register receiver = LoadIC::ReceiverRegister(); | 289 Register receiver = LoadConvention::ReceiverRegister(); |
290 DCHECK(receiver.is(x1)); | 290 DCHECK(receiver.is(x1)); |
291 DCHECK(key.is(x2)); | 291 DCHECK(key.is(x2)); |
292 | 292 |
293 __ JumpIfNotSmi(key, &miss); | 293 __ JumpIfNotSmi(key, &miss); |
294 __ Ldr(x4, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 294 __ Ldr(x4, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
295 __ LoadFromNumberDictionary(&slow, x4, key, result, x7, x3, x5, x6); | 295 __ LoadFromNumberDictionary(&slow, x4, key, result, x7, x3, x5, x6); |
296 __ Ret(); | 296 __ Ret(); |
297 | 297 |
298 __ Bind(&slow); | 298 __ Bind(&slow); |
299 __ IncrementCounter( | 299 __ IncrementCounter( |
300 masm->isolate()->counters()->keyed_load_external_array_slow(), 1, x4, x3); | 300 masm->isolate()->counters()->keyed_load_external_array_slow(), 1, x4, x3); |
301 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); | 301 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); |
302 | 302 |
303 // Miss case, call the runtime. | 303 // Miss case, call the runtime. |
304 __ Bind(&miss); | 304 __ Bind(&miss); |
305 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 305 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
306 } | 306 } |
307 | 307 |
308 | 308 |
309 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 309 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
310 // Push receiver, name and value for runtime call. | 310 // Push receiver, name and value for runtime call. |
311 __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(), | 311 __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), |
312 StoreIC::ValueRegister()); | 312 StoreConvention::ValueRegister()); |
313 | 313 |
314 // The slow case calls into the runtime to complete the store without causing | 314 // The slow case calls into the runtime to complete the store without causing |
315 // an IC miss that would otherwise cause a transition to the generic stub. | 315 // an IC miss that would otherwise cause a transition to the generic stub. |
316 ExternalReference ref = | 316 ExternalReference ref = |
317 ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate()); | 317 ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate()); |
318 __ TailCallExternalReference(ref, 3, 1); | 318 __ TailCallExternalReference(ref, 3, 1); |
319 } | 319 } |
320 | 320 |
321 | 321 |
322 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 322 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
323 ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow"); | 323 ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow"); |
324 | 324 |
325 // Push receiver, key and value for runtime call. | 325 // Push receiver, key and value for runtime call. |
326 __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(), | 326 __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), |
327 StoreIC::ValueRegister()); | 327 StoreConvention::ValueRegister()); |
328 | 328 |
329 // The slow case calls into the runtime to complete the store without causing | 329 // The slow case calls into the runtime to complete the store without causing |
330 // an IC miss that would otherwise cause a transition to the generic stub. | 330 // an IC miss that would otherwise cause a transition to the generic stub. |
331 ExternalReference ref = | 331 ExternalReference ref = |
332 ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate()); | 332 ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate()); |
333 __ TailCallExternalReference(ref, 3, 1); | 333 __ TailCallExternalReference(ref, 3, 1); |
334 } | 334 } |
335 | 335 |
336 | 336 |
337 #undef __ | 337 #undef __ |
338 #define __ ACCESS_MASM(masm()) | 338 #define __ ACCESS_MASM(masm()) |
339 | 339 |
340 | 340 |
341 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( | 341 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( |
342 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { | 342 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { |
343 Label miss; | 343 Label miss; |
344 FrontendHeader(receiver(), name, &miss); | 344 FrontendHeader(receiver(), name, &miss); |
345 | 345 |
346 // Get the value from the cell. | 346 // Get the value from the cell. |
347 Register result = StoreIC::ValueRegister(); | 347 Register result = StoreConvention::ValueRegister(); |
348 __ Mov(result, Operand(cell)); | 348 __ Mov(result, Operand(cell)); |
349 __ Ldr(result, FieldMemOperand(result, Cell::kValueOffset)); | 349 __ Ldr(result, FieldMemOperand(result, Cell::kValueOffset)); |
350 | 350 |
351 // Check for deleted property if property can actually be deleted. | 351 // Check for deleted property if property can actually be deleted. |
352 if (is_configurable) { | 352 if (is_configurable) { |
353 __ JumpIfRoot(result, Heap::kTheHoleValueRootIndex, &miss); | 353 __ JumpIfRoot(result, Heap::kTheHoleValueRootIndex, &miss); |
354 } | 354 } |
355 | 355 |
356 Counters* counters = isolate()->counters(); | 356 Counters* counters = isolate()->counters(); |
357 __ IncrementCounter(counters->named_load_global_stub(), 1, x1, x3); | 357 __ IncrementCounter(counters->named_load_global_stub(), 1, x1, x3); |
(...skipping 17 matching lines...) Expand all Loading... |
375 // Do tail-call to the runtime system. | 375 // Do tail-call to the runtime system. |
376 ExternalReference store_ic_property = ExternalReference( | 376 ExternalReference store_ic_property = ExternalReference( |
377 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); | 377 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); |
378 __ TailCallExternalReference(store_ic_property, 3, 1); | 378 __ TailCallExternalReference(store_ic_property, 3, 1); |
379 | 379 |
380 // Return the generated code. | 380 // Return the generated code. |
381 return GetCode(kind(), Code::FAST, name); | 381 return GetCode(kind(), Code::FAST, name); |
382 } | 382 } |
383 | 383 |
384 | 384 |
385 Register NamedStoreHandlerCompiler::value() { return StoreIC::ValueRegister(); } | 385 Register NamedStoreHandlerCompiler::value() { |
| 386 return StoreConvention::ValueRegister(); |
| 387 } |
386 | 388 |
387 | 389 |
388 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 390 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
389 Handle<Name> name) { | 391 Handle<Name> name) { |
390 if (!label->is_unused()) { | 392 if (!label->is_unused()) { |
391 __ Bind(label); | 393 __ Bind(label); |
392 __ Mov(this->name(), Operand(name)); | 394 __ Mov(this->name(), Operand(name)); |
393 } | 395 } |
394 } | 396 } |
395 | 397 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 // Return the generated code. | 865 // Return the generated code. |
864 return GetCode(kind(), Code::FAST, name); | 866 return GetCode(kind(), Code::FAST, name); |
865 } | 867 } |
866 | 868 |
867 | 869 |
868 #undef __ | 870 #undef __ |
869 } | 871 } |
870 } // namespace v8::internal | 872 } // namespace v8::internal |
871 | 873 |
872 #endif // V8_TARGET_ARCH_IA32 | 874 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |