OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 4303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4314 void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) { | 4314 void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) { |
4315 DCHECK(expr->arguments()->length() == 0); | 4315 DCHECK(expr->arguments()->length() == 0); |
4316 ExternalReference debug_is_active = | 4316 ExternalReference debug_is_active = |
4317 ExternalReference::debug_is_active_address(isolate()); | 4317 ExternalReference::debug_is_active_address(isolate()); |
4318 __ movzx_b(eax, Operand::StaticVariable(debug_is_active)); | 4318 __ movzx_b(eax, Operand::StaticVariable(debug_is_active)); |
4319 __ SmiTag(eax); | 4319 __ SmiTag(eax); |
4320 context()->Plug(eax); | 4320 context()->Plug(eax); |
4321 } | 4321 } |
4322 | 4322 |
4323 | 4323 |
| 4324 void FullCodeGenerator::EmitHasFastPackedElements(CallRuntime* expr) { |
| 4325 ZoneList<Expression*>* args = expr->arguments(); |
| 4326 DCHECK(args->length() == 1); |
| 4327 |
| 4328 VisitForAccumulatorValue(args->at(0)); |
| 4329 |
| 4330 Label materialize_true, materialize_false; |
| 4331 Label* if_true = NULL; |
| 4332 Label* if_false = NULL; |
| 4333 Label* fall_through = NULL; |
| 4334 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 4335 &if_false, &fall_through); |
| 4336 |
| 4337 __ JumpIfSmi(eax, if_false); |
| 4338 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); |
| 4339 __ movzx_b(eax, FieldOperand(eax, Map::kBitField2Offset)); |
| 4340 __ shr(eax, Map::ElementsKindBits::kShift); |
| 4341 __ cmp(eax, Immediate(FAST_SMI_ELEMENTS)); |
| 4342 __ j(equal, if_true); |
| 4343 __ cmp(eax, Immediate(FAST_ELEMENTS)); |
| 4344 __ j(equal, if_true); |
| 4345 __ cmp(eax, Immediate(FAST_DOUBLE_ELEMENTS)); |
| 4346 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 4347 Split(equal, if_true, if_false, fall_through); |
| 4348 |
| 4349 context()->Plug(if_true, if_false); |
| 4350 } |
| 4351 |
| 4352 |
4324 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 4353 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
4325 if (expr->function() != NULL && | 4354 if (expr->function() != NULL && |
4326 expr->function()->intrinsic_type == Runtime::INLINE) { | 4355 expr->function()->intrinsic_type == Runtime::INLINE) { |
4327 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 4356 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
4328 EmitInlineRuntimeCall(expr); | 4357 EmitInlineRuntimeCall(expr); |
4329 return; | 4358 return; |
4330 } | 4359 } |
4331 | 4360 |
4332 Comment cmnt(masm_, "[ CallRuntime"); | 4361 Comment cmnt(masm_, "[ CallRuntime"); |
4333 ZoneList<Expression*>* args = expr->arguments(); | 4362 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5176 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5205 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5177 Assembler::target_address_at(call_target_address, | 5206 Assembler::target_address_at(call_target_address, |
5178 unoptimized_code)); | 5207 unoptimized_code)); |
5179 return OSR_AFTER_STACK_CHECK; | 5208 return OSR_AFTER_STACK_CHECK; |
5180 } | 5209 } |
5181 | 5210 |
5182 | 5211 |
5183 } } // namespace v8::internal | 5212 } } // namespace v8::internal |
5184 | 5213 |
5185 #endif // V8_TARGET_ARCH_IA32 | 5214 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |