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

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

Issue 1288923002: Revert of [runtime] Remove useless IN builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/hydrogen.cc » ('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/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after
3224 Label* if_false = NULL; 3224 Label* if_false = NULL;
3225 Label* fall_through = NULL; 3225 Label* fall_through = NULL;
3226 context()->PrepareTest(&materialize_true, &materialize_false, 3226 context()->PrepareTest(&materialize_true, &materialize_false,
3227 &if_true, &if_false, &fall_through); 3227 &if_true, &if_false, &fall_through);
3228 3228
3229 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 3229 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3230 __ test(eax, Immediate(kSmiTagMask)); 3230 __ test(eax, Immediate(kSmiTagMask));
3231 Split(zero, if_true, if_false, fall_through); 3231 Split(zero, if_true, if_false, fall_through);
3232 3232
3233 context()->Plug(if_true, if_false); 3233 context()->Plug(if_true, if_false);
3234 }
3235
3236
3237 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) {
3238 ZoneList<Expression*>* args = expr->arguments();
3239 DCHECK(args->length() == 1);
3240
3241 VisitForAccumulatorValue(args->at(0));
3242
3243 Label materialize_true, materialize_false;
3244 Label* if_true = NULL;
3245 Label* if_false = NULL;
3246 Label* fall_through = NULL;
3247 context()->PrepareTest(&materialize_true, &materialize_false,
3248 &if_true, &if_false, &fall_through);
3249
3250 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3251 __ test(eax, Immediate(kSmiTagMask | 0x80000000));
3252 Split(zero, if_true, if_false, fall_through);
3253
3254 context()->Plug(if_true, if_false);
3234 } 3255 }
3235 3256
3236 3257
3237 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { 3258 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) {
3238 ZoneList<Expression*>* args = expr->arguments(); 3259 ZoneList<Expression*>* args = expr->arguments();
3239 DCHECK(args->length() == 1); 3260 DCHECK(args->length() == 1);
3240 3261
3241 VisitForAccumulatorValue(args->at(0)); 3262 VisitForAccumulatorValue(args->at(0));
3242 3263
3243 Label materialize_true, materialize_false; 3264 Label materialize_true, materialize_false;
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after
5014 Label* if_false = NULL; 5035 Label* if_false = NULL;
5015 Label* fall_through = NULL; 5036 Label* fall_through = NULL;
5016 context()->PrepareTest(&materialize_true, &materialize_false, 5037 context()->PrepareTest(&materialize_true, &materialize_false,
5017 &if_true, &if_false, &fall_through); 5038 &if_true, &if_false, &fall_through);
5018 5039
5019 Token::Value op = expr->op(); 5040 Token::Value op = expr->op();
5020 VisitForStackValue(expr->left()); 5041 VisitForStackValue(expr->left());
5021 switch (op) { 5042 switch (op) {
5022 case Token::IN: 5043 case Token::IN:
5023 VisitForStackValue(expr->right()); 5044 VisitForStackValue(expr->right());
5024 __ CallRuntime(Runtime::kHasProperty, 2); 5045 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION);
5025 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); 5046 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL);
5026 __ cmp(eax, isolate()->factory()->true_value()); 5047 __ cmp(eax, isolate()->factory()->true_value());
5027 Split(equal, if_true, if_false, fall_through); 5048 Split(equal, if_true, if_false, fall_through);
5028 break; 5049 break;
5029 5050
5030 case Token::INSTANCEOF: { 5051 case Token::INSTANCEOF: {
5031 VisitForStackValue(expr->right()); 5052 VisitForStackValue(expr->right());
5032 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); 5053 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags);
5033 __ CallStub(&stub); 5054 __ CallStub(&stub);
5034 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 5055 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
5287 Assembler::target_address_at(call_target_address, 5308 Assembler::target_address_at(call_target_address,
5288 unoptimized_code)); 5309 unoptimized_code));
5289 return OSR_AFTER_STACK_CHECK; 5310 return OSR_AFTER_STACK_CHECK;
5290 } 5311 }
5291 5312
5292 5313
5293 } // namespace internal 5314 } // namespace internal
5294 } // namespace v8 5315 } // namespace v8
5295 5316
5296 #endif // V8_TARGET_ARCH_X87 5317 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698