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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3402 // Convert the object to an integer. | 3402 // Convert the object to an integer. |
3403 Label done_convert; | 3403 Label done_convert; |
3404 __ JumpIfSmi(eax, &done_convert, Label::kNear); | 3404 __ JumpIfSmi(eax, &done_convert, Label::kNear); |
3405 __ Push(eax); | 3405 __ Push(eax); |
3406 __ CallRuntime(Runtime::kToInteger); | 3406 __ CallRuntime(Runtime::kToInteger); |
3407 __ bind(&done_convert); | 3407 __ bind(&done_convert); |
3408 context()->Plug(eax); | 3408 context()->Plug(eax); |
3409 } | 3409 } |
3410 | 3410 |
3411 | 3411 |
3412 void FullCodeGenerator::EmitToName(CallRuntime* expr) { | |
3413 ZoneList<Expression*>* args = expr->arguments(); | |
3414 DCHECK_EQ(1, args->length()); | |
3415 | |
3416 // Load the argument into eax and convert it. | |
3417 VisitForAccumulatorValue(args->at(0)); | |
3418 | |
3419 // Convert the object to a name. | |
3420 Label convert, done_convert; | |
3421 __ JumpIfSmi(eax, &convert, Label::kNear); | |
3422 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); | |
3423 __ CmpObjectType(eax, LAST_NAME_TYPE, ecx); | |
3424 __ j(below_equal, &done_convert, Label::kNear); | |
3425 __ bind(&convert); | |
3426 __ Push(eax); | |
3427 __ CallRuntime(Runtime::kToName); | |
3428 __ bind(&done_convert); | |
3429 context()->Plug(eax); | |
3430 } | |
3431 | |
3432 | |
3433 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { | 3412 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { |
3434 ZoneList<Expression*>* args = expr->arguments(); | 3413 ZoneList<Expression*>* args = expr->arguments(); |
3435 DCHECK(args->length() == 1); | 3414 DCHECK(args->length() == 1); |
3436 | 3415 |
3437 VisitForAccumulatorValue(args->at(0)); | 3416 VisitForAccumulatorValue(args->at(0)); |
3438 | 3417 |
3439 Label done; | 3418 Label done; |
3440 StringCharFromCodeGenerator generator(eax, ebx); | 3419 StringCharFromCodeGenerator generator(eax, ebx); |
3441 generator.GenerateFast(masm_); | 3420 generator.GenerateFast(masm_); |
3442 __ jmp(&done); | 3421 __ jmp(&done); |
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4731 Assembler::target_address_at(call_target_address, | 4710 Assembler::target_address_at(call_target_address, |
4732 unoptimized_code)); | 4711 unoptimized_code)); |
4733 return OSR_AFTER_STACK_CHECK; | 4712 return OSR_AFTER_STACK_CHECK; |
4734 } | 4713 } |
4735 | 4714 |
4736 | 4715 |
4737 } // namespace internal | 4716 } // namespace internal |
4738 } // namespace v8 | 4717 } // namespace v8 |
4739 | 4718 |
4740 #endif // V8_TARGET_ARCH_X87 | 4719 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |