OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void LCodeGen::FinishCode(Handle<Code> code) { | 86 void LCodeGen::FinishCode(Handle<Code> code) { |
87 ASSERT(is_done()); | 87 ASSERT(is_done()); |
88 code->set_stack_slots(StackSlotCount()); | 88 code->set_stack_slots(StackSlotCount()); |
89 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 89 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
90 PopulateDeoptimizationData(code); | 90 PopulateDeoptimizationData(code); |
91 } | 91 } |
92 | 92 |
93 | 93 |
94 void LCodeGen::Abort(const char* format, ...) { | 94 void LCodeGen::Abort(const char* format, ...) { |
95 if (FLAG_trace_bailout) { | 95 if (FLAG_trace_bailout) { |
96 SmartPointer<char> debug_name = graph()->debug_name()->ToCString(); | 96 SmartPointer<char> name(info()->shared_info()->DebugName()->ToCString()); |
97 PrintF("Aborting LCodeGen in @\"%s\": ", *debug_name); | 97 PrintF("Aborting LCodeGen in @\"%s\": ", *name); |
98 va_list arguments; | 98 va_list arguments; |
99 va_start(arguments, format); | 99 va_start(arguments, format); |
100 OS::VPrint(format, arguments); | 100 OS::VPrint(format, arguments); |
101 va_end(arguments); | 101 va_end(arguments); |
102 PrintF("\n"); | 102 PrintF("\n"); |
103 } | 103 } |
104 status_ = ABORTED; | 104 status_ = ABORTED; |
105 } | 105 } |
106 | 106 |
107 | 107 |
(...skipping 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2354 Register result = ToRegister(instr->result()); | 2354 Register result = ToRegister(instr->result()); |
2355 __ mov(result, FieldOperand(global, GlobalObject::kGlobalReceiverOffset)); | 2355 __ mov(result, FieldOperand(global, GlobalObject::kGlobalReceiverOffset)); |
2356 } | 2356 } |
2357 | 2357 |
2358 | 2358 |
2359 void LCodeGen::CallKnownFunction(Handle<JSFunction> function, | 2359 void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
2360 int arity, | 2360 int arity, |
2361 LInstruction* instr) { | 2361 LInstruction* instr) { |
2362 // Change context if needed. | 2362 // Change context if needed. |
2363 bool change_context = | 2363 bool change_context = |
2364 (graph()->info()->closure()->context() != function->context()) || | 2364 (info()->closure()->context() != function->context()) || |
2365 scope()->contains_with() || | 2365 scope()->contains_with() || |
2366 (scope()->num_heap_slots() > 0); | 2366 (scope()->num_heap_slots() > 0); |
2367 if (change_context) { | 2367 if (change_context) { |
2368 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 2368 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
2369 } else { | 2369 } else { |
2370 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 2370 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
2371 } | 2371 } |
2372 | 2372 |
2373 // Set eax to arguments count if adaption is not needed. Assumes that eax | 2373 // Set eax to arguments count if adaption is not needed. Assumes that eax |
2374 // is available to write to at this point. | 2374 // is available to write to at this point. |
2375 if (!function->NeedsArgumentsAdaption()) { | 2375 if (!function->NeedsArgumentsAdaption()) { |
2376 __ mov(eax, arity); | 2376 __ mov(eax, arity); |
2377 } | 2377 } |
2378 | 2378 |
2379 LPointerMap* pointers = instr->pointer_map(); | 2379 LPointerMap* pointers = instr->pointer_map(); |
2380 RecordPosition(pointers->position()); | 2380 RecordPosition(pointers->position()); |
2381 | 2381 |
2382 // Invoke function. | 2382 // Invoke function. |
2383 if (*function == *graph()->info()->closure()) { | 2383 if (*function == *info()->closure()) { |
2384 __ CallSelf(); | 2384 __ CallSelf(); |
2385 } else { | 2385 } else { |
2386 __ call(FieldOperand(edi, JSFunction::kCodeEntryOffset)); | 2386 __ call(FieldOperand(edi, JSFunction::kCodeEntryOffset)); |
2387 EnsureRelocSpaceForDeoptimization(); | 2387 EnsureRelocSpaceForDeoptimization(); |
2388 } | 2388 } |
2389 | 2389 |
2390 // Setup deoptimization. | 2390 // Setup deoptimization. |
2391 RegisterLazyDeoptimization(instr); | 2391 RegisterLazyDeoptimization(instr); |
2392 } | 2392 } |
2393 | 2393 |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3874 ASSERT(osr_pc_offset_ == -1); | 3874 ASSERT(osr_pc_offset_ == -1); |
3875 osr_pc_offset_ = masm()->pc_offset(); | 3875 osr_pc_offset_ = masm()->pc_offset(); |
3876 } | 3876 } |
3877 | 3877 |
3878 | 3878 |
3879 #undef __ | 3879 #undef __ |
3880 | 3880 |
3881 } } // namespace v8::internal | 3881 } } // namespace v8::internal |
3882 | 3882 |
3883 #endif // V8_TARGET_ARCH_IA32 | 3883 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |