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/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/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 4049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4060 DCHECK(expr->arguments()->length() == 0); | 4060 DCHECK(expr->arguments()->length() == 0); |
4061 ExternalReference debug_is_active = | 4061 ExternalReference debug_is_active = |
4062 ExternalReference::debug_is_active_address(isolate()); | 4062 ExternalReference::debug_is_active_address(isolate()); |
4063 __ Mov(x10, debug_is_active); | 4063 __ Mov(x10, debug_is_active); |
4064 __ Ldrb(x0, MemOperand(x10)); | 4064 __ Ldrb(x0, MemOperand(x10)); |
4065 __ SmiTag(x0); | 4065 __ SmiTag(x0); |
4066 context()->Plug(x0); | 4066 context()->Plug(x0); |
4067 } | 4067 } |
4068 | 4068 |
4069 | 4069 |
| 4070 void FullCodeGenerator::EmitHasFastPackedElements(CallRuntime* expr) { |
| 4071 ZoneList<Expression*>* args = expr->arguments(); |
| 4072 DCHECK(args->length() == 1); |
| 4073 |
| 4074 VisitForAccumulatorValue(args->at(0)); |
| 4075 |
| 4076 Label materialize_true, materialize_false; |
| 4077 Label* if_true = NULL; |
| 4078 Label* if_false = NULL; |
| 4079 Label* fall_through = NULL; |
| 4080 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 4081 &if_false, &fall_through); |
| 4082 |
| 4083 Register object = x0; |
| 4084 Register map = x10; |
| 4085 Register elements_kind = x11; |
| 4086 |
| 4087 __ JumpIfSmi(object, if_false); |
| 4088 __ Ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 4089 __ Ldrb(elements_kind, FieldMemOperand(map, Map::kBitField2Offset)); |
| 4090 __ Lsr(elements_kind, elements_kind, Map::ElementsKindBits::kShift); |
| 4091 __ Cmp(elements_kind, Operand(FAST_SMI_ELEMENTS)); |
| 4092 __ B(eq, if_true); |
| 4093 __ Cmp(elements_kind, Operand(FAST_ELEMENTS)); |
| 4094 __ B(eq, if_true); |
| 4095 __ Cmp(elements_kind, Operand(FAST_DOUBLE_ELEMENTS)); |
| 4096 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 4097 Split(eq, if_true, if_false, fall_through); |
| 4098 |
| 4099 context()->Plug(if_true, if_false); |
| 4100 } |
| 4101 |
| 4102 |
4070 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 4103 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
4071 if (expr->function() != NULL && | 4104 if (expr->function() != NULL && |
4072 expr->function()->intrinsic_type == Runtime::INLINE) { | 4105 expr->function()->intrinsic_type == Runtime::INLINE) { |
4073 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 4106 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
4074 EmitInlineRuntimeCall(expr); | 4107 EmitInlineRuntimeCall(expr); |
4075 return; | 4108 return; |
4076 } | 4109 } |
4077 | 4110 |
4078 Comment cmnt(masm_, "[ CallRunTime"); | 4111 Comment cmnt(masm_, "[ CallRunTime"); |
4079 ZoneList<Expression*>* args = expr->arguments(); | 4112 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5278 return previous_; | 5311 return previous_; |
5279 } | 5312 } |
5280 | 5313 |
5281 | 5314 |
5282 #undef __ | 5315 #undef __ |
5283 | 5316 |
5284 | 5317 |
5285 } } // namespace v8::internal | 5318 } } // namespace v8::internal |
5286 | 5319 |
5287 #endif // V8_TARGET_ARCH_ARM64 | 5320 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |