| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4377 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4377 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 4378 __ bind(&done); | 4378 __ bind(&done); |
| 4379 } else { | 4379 } else { |
| 4380 ArrayNArgumentsConstructorStub stub(kind, context_mode, override_mode); | 4380 ArrayNArgumentsConstructorStub stub(kind, context_mode, override_mode); |
| 4381 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4381 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 4382 } | 4382 } |
| 4383 } | 4383 } |
| 4384 | 4384 |
| 4385 | 4385 |
| 4386 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 4386 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
| 4387 ASSERT(ToRegister(instr->context()).is(esi)); |
| 4387 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); | 4388 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); |
| 4388 } | 4389 } |
| 4389 | 4390 |
| 4390 | 4391 |
| 4391 void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) { | 4392 void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) { |
| 4392 Register function = ToRegister(instr->function()); | 4393 Register function = ToRegister(instr->function()); |
| 4393 Register code_object = ToRegister(instr->code_object()); | 4394 Register code_object = ToRegister(instr->code_object()); |
| 4394 __ lea(code_object, FieldOperand(code_object, Code::kHeaderSize)); | 4395 __ lea(code_object, FieldOperand(code_object, Code::kHeaderSize)); |
| 4395 __ mov(FieldOperand(function, JSFunction::kCodeEntryOffset), code_object); | 4396 __ mov(FieldOperand(function, JSFunction::kCodeEntryOffset), code_object); |
| 4396 } | 4397 } |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4950 | 4951 |
| 4951 PushSafepointRegistersScope scope(this); | 4952 PushSafepointRegistersScope scope(this); |
| 4952 __ SmiTag(char_code); | 4953 __ SmiTag(char_code); |
| 4953 __ push(char_code); | 4954 __ push(char_code); |
| 4954 CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr, instr->context()); | 4955 CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr, instr->context()); |
| 4955 __ StoreToSafepointRegisterSlot(result, eax); | 4956 __ StoreToSafepointRegisterSlot(result, eax); |
| 4956 } | 4957 } |
| 4957 | 4958 |
| 4958 | 4959 |
| 4959 void LCodeGen::DoStringAdd(LStringAdd* instr) { | 4960 void LCodeGen::DoStringAdd(LStringAdd* instr) { |
| 4961 ASSERT(ToRegister(instr->context()).is(esi)); |
| 4960 EmitPushTaggedOperand(instr->left()); | 4962 EmitPushTaggedOperand(instr->left()); |
| 4961 EmitPushTaggedOperand(instr->right()); | 4963 EmitPushTaggedOperand(instr->right()); |
| 4962 StringAddStub stub(instr->hydrogen()->flags()); | 4964 StringAddStub stub(instr->hydrogen()->flags()); |
| 4963 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 4965 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 4964 } | 4966 } |
| 4965 | 4967 |
| 4966 | 4968 |
| 4967 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { | 4969 void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
| 4968 LOperand* input = instr->value(); | 4970 LOperand* input = instr->value(); |
| 4969 LOperand* output = instr->result(); | 4971 LOperand* output = instr->result(); |
| (...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6043 __ push(esi); | 6045 __ push(esi); |
| 6044 __ push(Immediate(instr->hydrogen()->shared_info())); | 6046 __ push(Immediate(instr->hydrogen()->shared_info())); |
| 6045 __ push(Immediate(pretenure ? factory()->true_value() | 6047 __ push(Immediate(pretenure ? factory()->true_value() |
| 6046 : factory()->false_value())); | 6048 : factory()->false_value())); |
| 6047 CallRuntime(Runtime::kNewClosure, 3, instr); | 6049 CallRuntime(Runtime::kNewClosure, 3, instr); |
| 6048 } | 6050 } |
| 6049 } | 6051 } |
| 6050 | 6052 |
| 6051 | 6053 |
| 6052 void LCodeGen::DoTypeof(LTypeof* instr) { | 6054 void LCodeGen::DoTypeof(LTypeof* instr) { |
| 6055 ASSERT(ToRegister(instr->context()).is(esi)); |
| 6053 LOperand* input = instr->value(); | 6056 LOperand* input = instr->value(); |
| 6054 EmitPushTaggedOperand(input); | 6057 EmitPushTaggedOperand(input); |
| 6055 CallRuntime(Runtime::kTypeof, 1, instr); | 6058 CallRuntime(Runtime::kTypeof, 1, instr); |
| 6056 } | 6059 } |
| 6057 | 6060 |
| 6058 | 6061 |
| 6059 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { | 6062 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { |
| 6060 Register input = ToRegister(instr->value()); | 6063 Register input = ToRegister(instr->value()); |
| 6061 | 6064 |
| 6062 Condition final_branch_condition = | 6065 Condition final_branch_condition = |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6287 // If the environment were already registered, we would have no way of | 6290 // If the environment were already registered, we would have no way of |
| 6288 // backpatching it with the spill slot operands. | 6291 // backpatching it with the spill slot operands. |
| 6289 ASSERT(!environment->HasBeenRegistered()); | 6292 ASSERT(!environment->HasBeenRegistered()); |
| 6290 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 6293 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 6291 | 6294 |
| 6292 GenerateOsrPrologue(); | 6295 GenerateOsrPrologue(); |
| 6293 } | 6296 } |
| 6294 | 6297 |
| 6295 | 6298 |
| 6296 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { | 6299 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { |
| 6300 ASSERT(ToRegister(instr->context()).is(esi)); |
| 6297 __ cmp(eax, isolate()->factory()->undefined_value()); | 6301 __ cmp(eax, isolate()->factory()->undefined_value()); |
| 6298 DeoptimizeIf(equal, instr->environment()); | 6302 DeoptimizeIf(equal, instr->environment()); |
| 6299 | 6303 |
| 6300 __ cmp(eax, isolate()->factory()->null_value()); | 6304 __ cmp(eax, isolate()->factory()->null_value()); |
| 6301 DeoptimizeIf(equal, instr->environment()); | 6305 DeoptimizeIf(equal, instr->environment()); |
| 6302 | 6306 |
| 6303 __ test(eax, Immediate(kSmiTagMask)); | 6307 __ test(eax, Immediate(kSmiTagMask)); |
| 6304 DeoptimizeIf(zero, instr->environment()); | 6308 DeoptimizeIf(zero, instr->environment()); |
| 6305 | 6309 |
| 6306 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 6310 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6378 FixedArray::kHeaderSize - kPointerSize)); | 6382 FixedArray::kHeaderSize - kPointerSize)); |
| 6379 __ bind(&done); | 6383 __ bind(&done); |
| 6380 } | 6384 } |
| 6381 | 6385 |
| 6382 | 6386 |
| 6383 #undef __ | 6387 #undef __ |
| 6384 | 6388 |
| 6385 } } // namespace v8::internal | 6389 } } // namespace v8::internal |
| 6386 | 6390 |
| 6387 #endif // V8_TARGET_ARCH_IA32 | 6391 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |