Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.cc

Issue 2117273002: Revert of [intrinsic] Drop the %_ValueOf intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/js/harmony-simd.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 // Objects with a non-function constructor have class 'Object'. 2725 // Objects with a non-function constructor have class 'Object'.
2726 __ bind(&non_function_constructor); 2726 __ bind(&non_function_constructor);
2727 __ mov(eax, isolate()->factory()->Object_string()); 2727 __ mov(eax, isolate()->factory()->Object_string());
2728 2728
2729 // All done. 2729 // All done.
2730 __ bind(&done); 2730 __ bind(&done);
2731 2731
2732 context()->Plug(eax); 2732 context()->Plug(eax);
2733 } 2733 }
2734 2734
2735
2736 void FullCodeGenerator::EmitValueOf(CallRuntime* expr) {
2737 ZoneList<Expression*>* args = expr->arguments();
2738 DCHECK(args->length() == 1);
2739
2740 VisitForAccumulatorValue(args->at(0)); // Load the object.
2741
2742 Label done;
2743 // If the object is a smi return the object.
2744 __ JumpIfSmi(eax, &done, Label::kNear);
2745 // If the object is not a value type, return the object.
2746 __ CmpObjectType(eax, JS_VALUE_TYPE, ebx);
2747 __ j(not_equal, &done, Label::kNear);
2748 __ mov(eax, FieldOperand(eax, JSValue::kValueOffset));
2749
2750 __ bind(&done);
2751 context()->Plug(eax);
2752 }
2753
2735 2754
2736 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 2755 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
2737 ZoneList<Expression*>* args = expr->arguments(); 2756 ZoneList<Expression*>* args = expr->arguments();
2738 DCHECK(args->length() == 1); 2757 DCHECK(args->length() == 1);
2739 2758
2740 VisitForAccumulatorValue(args->at(0)); 2759 VisitForAccumulatorValue(args->at(0));
2741 2760
2742 Label done; 2761 Label done;
2743 StringCharFromCodeGenerator generator(eax, ebx); 2762 StringCharFromCodeGenerator generator(eax, ebx);
2744 generator.GenerateFast(masm_); 2763 generator.GenerateFast(masm_);
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
3660 isolate->builtins()->OnStackReplacement()->entry(), 3679 isolate->builtins()->OnStackReplacement()->entry(),
3661 Assembler::target_address_at(call_target_address, unoptimized_code)); 3680 Assembler::target_address_at(call_target_address, unoptimized_code));
3662 return ON_STACK_REPLACEMENT; 3681 return ON_STACK_REPLACEMENT;
3663 } 3682 }
3664 3683
3665 3684
3666 } // namespace internal 3685 } // namespace internal
3667 } // namespace v8 3686 } // namespace v8
3668 3687
3669 #endif // V8_TARGET_ARCH_X87 3688 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/js/harmony-simd.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698