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

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

Issue 1698343002: [builtins] Move the Boolean constructor to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Also remove it from ia32 of course. Created 4 years, 10 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/v8natives.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 3122 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 } 3133 }
3134 3134
3135 __ SmiUntag(value); 3135 __ SmiUntag(value);
3136 // No need to untag a smi for two-byte addressing. 3136 // No need to untag a smi for two-byte addressing.
3137 __ mov_w(FieldOperand(string, index, times_1, SeqTwoByteString::kHeaderSize), 3137 __ mov_w(FieldOperand(string, index, times_1, SeqTwoByteString::kHeaderSize),
3138 value); 3138 value);
3139 context()->Plug(string); 3139 context()->Plug(string);
3140 } 3140 }
3141 3141
3142 3142
3143 void FullCodeGenerator::EmitSetValueOf(CallRuntime* expr) {
3144 ZoneList<Expression*>* args = expr->arguments();
3145 DCHECK(args->length() == 2);
3146
3147 VisitForStackValue(args->at(0)); // Load the object.
3148 VisitForAccumulatorValue(args->at(1)); // Load the value.
3149 __ pop(ebx); // eax = value. ebx = object.
3150
3151 Label done;
3152 // If the object is a smi, return the value.
3153 __ JumpIfSmi(ebx, &done, Label::kNear);
3154
3155 // If the object is not a value type, return the value.
3156 __ CmpObjectType(ebx, JS_VALUE_TYPE, ecx);
3157 __ j(not_equal, &done, Label::kNear);
3158
3159 // Store the value.
3160 __ mov(FieldOperand(ebx, JSValue::kValueOffset), eax);
3161
3162 // Update the write barrier. Save the value as it will be
3163 // overwritten by the write barrier code and is needed afterward.
3164 __ mov(edx, eax);
3165 __ RecordWriteField(ebx, JSValue::kValueOffset, edx, ecx, kDontSaveFPRegs);
3166
3167 __ bind(&done);
3168 context()->Plug(eax);
3169 }
3170
3171
3172 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { 3143 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) {
3173 ZoneList<Expression*>* args = expr->arguments(); 3144 ZoneList<Expression*>* args = expr->arguments();
3174 DCHECK_EQ(1, args->length()); 3145 DCHECK_EQ(1, args->length());
3175 3146
3176 // Load the argument into eax and convert it. 3147 // Load the argument into eax and convert it.
3177 VisitForAccumulatorValue(args->at(0)); 3148 VisitForAccumulatorValue(args->at(0));
3178 3149
3179 // Convert the object to an integer. 3150 // Convert the object to an integer.
3180 Label done_convert; 3151 Label done_convert;
3181 __ JumpIfSmi(eax, &done_convert, Label::kNear); 3152 __ JumpIfSmi(eax, &done_convert, Label::kNear);
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
4491 Assembler::target_address_at(call_target_address, 4462 Assembler::target_address_at(call_target_address,
4492 unoptimized_code)); 4463 unoptimized_code));
4493 return OSR_AFTER_STACK_CHECK; 4464 return OSR_AFTER_STACK_CHECK;
4494 } 4465 }
4495 4466
4496 4467
4497 } // namespace internal 4468 } // namespace internal
4498 } // namespace v8 4469 } // namespace v8
4499 4470
4500 #endif // V8_TARGET_ARCH_X87 4471 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/js/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698