| 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/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 3216 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 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 } | 3234 } | 
| 3235 | 3235 | 
| 3236 | 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); |  | 
| 3255 } |  | 
| 3256 |  | 
| 3257 |  | 
| 3258 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { | 3237 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { | 
| 3259   ZoneList<Expression*>* args = expr->arguments(); | 3238   ZoneList<Expression*>* args = expr->arguments(); | 
| 3260   DCHECK(args->length() == 1); | 3239   DCHECK(args->length() == 1); | 
| 3261 | 3240 | 
| 3262   VisitForAccumulatorValue(args->at(0)); | 3241   VisitForAccumulatorValue(args->at(0)); | 
| 3263 | 3242 | 
| 3264   Label materialize_true, materialize_false; | 3243   Label materialize_true, materialize_false; | 
| 3265   Label* if_true = NULL; | 3244   Label* if_true = NULL; | 
| 3266   Label* if_false = NULL; | 3245   Label* if_false = NULL; | 
| 3267   Label* fall_through = NULL; | 3246   Label* fall_through = NULL; | 
| (...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5035   Label* if_false = NULL; | 5014   Label* if_false = NULL; | 
| 5036   Label* fall_through = NULL; | 5015   Label* fall_through = NULL; | 
| 5037   context()->PrepareTest(&materialize_true, &materialize_false, | 5016   context()->PrepareTest(&materialize_true, &materialize_false, | 
| 5038                          &if_true, &if_false, &fall_through); | 5017                          &if_true, &if_false, &fall_through); | 
| 5039 | 5018 | 
| 5040   Token::Value op = expr->op(); | 5019   Token::Value op = expr->op(); | 
| 5041   VisitForStackValue(expr->left()); | 5020   VisitForStackValue(expr->left()); | 
| 5042   switch (op) { | 5021   switch (op) { | 
| 5043     case Token::IN: | 5022     case Token::IN: | 
| 5044       VisitForStackValue(expr->right()); | 5023       VisitForStackValue(expr->right()); | 
| 5045       __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); | 5024       __ CallRuntime(Runtime::kHasProperty, 2); | 
| 5046       PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 5025       PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 
| 5047       __ cmp(eax, isolate()->factory()->true_value()); | 5026       __ cmp(eax, isolate()->factory()->true_value()); | 
| 5048       Split(equal, if_true, if_false, fall_through); | 5027       Split(equal, if_true, if_false, fall_through); | 
| 5049       break; | 5028       break; | 
| 5050 | 5029 | 
| 5051     case Token::INSTANCEOF: { | 5030     case Token::INSTANCEOF: { | 
| 5052       VisitForStackValue(expr->right()); | 5031       VisitForStackValue(expr->right()); | 
| 5053       InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); | 5032       InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); | 
| 5054       __ CallStub(&stub); | 5033       __ CallStub(&stub); | 
| 5055       PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 5034       PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5308             Assembler::target_address_at(call_target_address, | 5287             Assembler::target_address_at(call_target_address, | 
| 5309                                          unoptimized_code)); | 5288                                          unoptimized_code)); | 
| 5310   return OSR_AFTER_STACK_CHECK; | 5289   return OSR_AFTER_STACK_CHECK; | 
| 5311 } | 5290 } | 
| 5312 | 5291 | 
| 5313 | 5292 | 
| 5314 }  // namespace internal | 5293 }  // namespace internal | 
| 5315 }  // namespace v8 | 5294 }  // namespace v8 | 
| 5316 | 5295 | 
| 5317 #endif  // V8_TARGET_ARCH_X87 | 5296 #endif  // V8_TARGET_ARCH_X87 | 
| OLD | NEW | 
|---|