OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/crankshaft/arm64/lithium-codegen-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 3221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3232 DCHECK(ToRegister(instr->result()).Is(x0)); | 3232 DCHECK(ToRegister(instr->result()).Is(x0)); |
3233 __ Mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 3233 __ Mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
3234 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3234 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
3235 Handle<Code> ic = | 3235 Handle<Code> ic = |
3236 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), | 3236 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), |
3237 SLOPPY, PREMONOMORPHIC).code(); | 3237 SLOPPY, PREMONOMORPHIC).code(); |
3238 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3238 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3239 } | 3239 } |
3240 | 3240 |
3241 | 3241 |
3242 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { | |
3243 DCHECK(ToRegister(instr->context()).is(cp)); | |
3244 DCHECK(ToRegister(instr->result()).is(x0)); | |
3245 | |
3246 int const slot = instr->slot_index(); | |
3247 int const depth = instr->depth(); | |
3248 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | |
3249 __ Mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | |
3250 Handle<Code> stub = | |
3251 CodeFactory::LoadGlobalViaContext(isolate(), depth).code(); | |
3252 CallCode(stub, RelocInfo::CODE_TARGET, instr); | |
3253 } else { | |
3254 __ Push(Smi::FromInt(slot)); | |
3255 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1); | |
3256 } | |
3257 } | |
3258 | |
3259 | |
3260 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand( | 3242 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand( |
3261 Register key, | 3243 Register key, |
3262 Register base, | 3244 Register base, |
3263 Register scratch, | 3245 Register scratch, |
3264 bool key_is_smi, | 3246 bool key_is_smi, |
3265 bool key_is_constant, | 3247 bool key_is_constant, |
3266 int constant_key, | 3248 int constant_key, |
3267 ElementsKind elements_kind, | 3249 ElementsKind elements_kind, |
3268 int base_offset) { | 3250 int base_offset) { |
3269 int element_size_shift = ElementsKindToShiftSize(elements_kind); | 3251 int element_size_shift = ElementsKindToShiftSize(elements_kind); |
(...skipping 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5360 } | 5342 } |
5361 | 5343 |
5362 __ Mov(StoreDescriptor::NameRegister(), Operand(instr->name())); | 5344 __ Mov(StoreDescriptor::NameRegister(), Operand(instr->name())); |
5363 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( | 5345 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( |
5364 isolate(), instr->language_mode(), | 5346 isolate(), instr->language_mode(), |
5365 instr->hydrogen()->initialization_state()).code(); | 5347 instr->hydrogen()->initialization_state()).code(); |
5366 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 5348 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
5367 } | 5349 } |
5368 | 5350 |
5369 | 5351 |
5370 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { | |
5371 DCHECK(ToRegister(instr->context()).is(cp)); | |
5372 DCHECK(ToRegister(instr->value()) | |
5373 .is(StoreGlobalViaContextDescriptor::ValueRegister())); | |
5374 | |
5375 int const slot = instr->slot_index(); | |
5376 int const depth = instr->depth(); | |
5377 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | |
5378 __ Mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | |
5379 Handle<Code> stub = CodeFactory::StoreGlobalViaContext( | |
5380 isolate(), depth, instr->language_mode()) | |
5381 .code(); | |
5382 CallCode(stub, RelocInfo::CODE_TARGET, instr); | |
5383 } else { | |
5384 __ Push(Smi::FromInt(slot)); | |
5385 __ Push(StoreGlobalViaContextDescriptor::ValueRegister()); | |
5386 __ CallRuntime(is_strict(instr->language_mode()) | |
5387 ? Runtime::kStoreGlobalViaContext_Strict | |
5388 : Runtime::kStoreGlobalViaContext_Sloppy, | |
5389 2); | |
5390 } | |
5391 } | |
5392 | |
5393 | |
5394 void LCodeGen::DoStringAdd(LStringAdd* instr) { | 5352 void LCodeGen::DoStringAdd(LStringAdd* instr) { |
5395 DCHECK(ToRegister(instr->context()).is(cp)); | 5353 DCHECK(ToRegister(instr->context()).is(cp)); |
5396 DCHECK(ToRegister(instr->left()).Is(x1)); | 5354 DCHECK(ToRegister(instr->left()).Is(x1)); |
5397 DCHECK(ToRegister(instr->right()).Is(x0)); | 5355 DCHECK(ToRegister(instr->right()).Is(x0)); |
5398 StringAddStub stub(isolate(), | 5356 StringAddStub stub(isolate(), |
5399 instr->hydrogen()->flags(), | 5357 instr->hydrogen()->flags(), |
5400 instr->hydrogen()->pretenure_flag()); | 5358 instr->hydrogen()->pretenure_flag()); |
5401 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 5359 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
5402 } | 5360 } |
5403 | 5361 |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6010 Handle<ScopeInfo> scope_info = instr->scope_info(); | 5968 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6011 __ Push(scope_info); | 5969 __ Push(scope_info); |
6012 __ Push(ToRegister(instr->function())); | 5970 __ Push(ToRegister(instr->function())); |
6013 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5971 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6014 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5972 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6015 } | 5973 } |
6016 | 5974 |
6017 | 5975 |
6018 } // namespace internal | 5976 } // namespace internal |
6019 } // namespace v8 | 5977 } // namespace v8 |
OLD | NEW |