| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3166 &if_true, &if_false, &fall_through); | 3166 &if_true, &if_false, &fall_through); |
| 3167 | 3167 |
| 3168 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3168 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3169 __ test(eax, Immediate(kSmiTagMask)); | 3169 __ test(eax, Immediate(kSmiTagMask)); |
| 3170 Split(zero, if_true, if_false, fall_through); | 3170 Split(zero, if_true, if_false, fall_through); |
| 3171 | 3171 |
| 3172 context()->Plug(if_true, if_false); | 3172 context()->Plug(if_true, if_false); |
| 3173 } | 3173 } |
| 3174 | 3174 |
| 3175 | 3175 |
| 3176 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) { | |
| 3177 ZoneList<Expression*>* args = expr->arguments(); | |
| 3178 DCHECK(args->length() == 1); | |
| 3179 | |
| 3180 VisitForAccumulatorValue(args->at(0)); | |
| 3181 | |
| 3182 Label materialize_true, materialize_false; | |
| 3183 Label* if_true = NULL; | |
| 3184 Label* if_false = NULL; | |
| 3185 Label* fall_through = NULL; | |
| 3186 context()->PrepareTest(&materialize_true, &materialize_false, | |
| 3187 &if_true, &if_false, &fall_through); | |
| 3188 | |
| 3189 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
| 3190 __ test(eax, Immediate(kSmiTagMask | 0x80000000)); | |
| 3191 Split(zero, if_true, if_false, fall_through); | |
| 3192 | |
| 3193 context()->Plug(if_true, if_false); | |
| 3194 } | |
| 3195 | |
| 3196 | |
| 3197 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { | 3176 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { |
| 3198 ZoneList<Expression*>* args = expr->arguments(); | 3177 ZoneList<Expression*>* args = expr->arguments(); |
| 3199 DCHECK(args->length() == 1); | 3178 DCHECK(args->length() == 1); |
| 3200 | 3179 |
| 3201 VisitForAccumulatorValue(args->at(0)); | 3180 VisitForAccumulatorValue(args->at(0)); |
| 3202 | 3181 |
| 3203 Label materialize_true, materialize_false; | 3182 Label materialize_true, materialize_false; |
| 3204 Label* if_true = NULL; | 3183 Label* if_true = NULL; |
| 3205 Label* if_false = NULL; | 3184 Label* if_false = NULL; |
| 3206 Label* fall_through = NULL; | 3185 Label* fall_through = NULL; |
| (...skipping 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4976 Label* if_false = NULL; | 4955 Label* if_false = NULL; |
| 4977 Label* fall_through = NULL; | 4956 Label* fall_through = NULL; |
| 4978 context()->PrepareTest(&materialize_true, &materialize_false, | 4957 context()->PrepareTest(&materialize_true, &materialize_false, |
| 4979 &if_true, &if_false, &fall_through); | 4958 &if_true, &if_false, &fall_through); |
| 4980 | 4959 |
| 4981 Token::Value op = expr->op(); | 4960 Token::Value op = expr->op(); |
| 4982 VisitForStackValue(expr->left()); | 4961 VisitForStackValue(expr->left()); |
| 4983 switch (op) { | 4962 switch (op) { |
| 4984 case Token::IN: | 4963 case Token::IN: |
| 4985 VisitForStackValue(expr->right()); | 4964 VisitForStackValue(expr->right()); |
| 4986 __ InvokeBuiltin(Context::IN_BUILTIN_INDEX, CALL_FUNCTION); | 4965 __ CallRuntime(Runtime::kHasProperty, 2); |
| 4987 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 4966 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 4988 __ cmp(eax, isolate()->factory()->true_value()); | 4967 __ cmp(eax, isolate()->factory()->true_value()); |
| 4989 Split(equal, if_true, if_false, fall_through); | 4968 Split(equal, if_true, if_false, fall_through); |
| 4990 break; | 4969 break; |
| 4991 | 4970 |
| 4992 case Token::INSTANCEOF: { | 4971 case Token::INSTANCEOF: { |
| 4993 VisitForAccumulatorValue(expr->right()); | 4972 VisitForAccumulatorValue(expr->right()); |
| 4994 __ Pop(edx); | 4973 __ Pop(edx); |
| 4995 InstanceOfStub stub(isolate()); | 4974 InstanceOfStub stub(isolate()); |
| 4996 __ CallStub(&stub); | 4975 __ CallStub(&stub); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5249 Assembler::target_address_at(call_target_address, | 5228 Assembler::target_address_at(call_target_address, |
| 5250 unoptimized_code)); | 5229 unoptimized_code)); |
| 5251 return OSR_AFTER_STACK_CHECK; | 5230 return OSR_AFTER_STACK_CHECK; |
| 5252 } | 5231 } |
| 5253 | 5232 |
| 5254 | 5233 |
| 5255 } // namespace internal | 5234 } // namespace internal |
| 5256 } // namespace v8 | 5235 } // namespace v8 |
| 5257 | 5236 |
| 5258 #endif // V8_TARGET_ARCH_IA32 | 5237 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |