| 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 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2271 mov(ebx, FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset)); | 2271 mov(ebx, FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset)); |
| 2272 SmiUntag(ebx); | 2272 SmiUntag(ebx); |
| 2273 | 2273 |
| 2274 ParameterCount expected(ebx); | 2274 ParameterCount expected(ebx); |
| 2275 InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), | 2275 InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), |
| 2276 expected, actual, flag, call_wrapper, call_kind); | 2276 expected, actual, flag, call_wrapper, call_kind); |
| 2277 } | 2277 } |
| 2278 | 2278 |
| 2279 | 2279 |
| 2280 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, | 2280 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, |
| 2281 const ParameterCount& expected, |
| 2281 const ParameterCount& actual, | 2282 const ParameterCount& actual, |
| 2282 InvokeFlag flag, | 2283 InvokeFlag flag, |
| 2283 const CallWrapper& call_wrapper, | 2284 const CallWrapper& call_wrapper, |
| 2284 CallKind call_kind) { | 2285 CallKind call_kind) { |
| 2285 // You can't call a function without a valid frame. | 2286 // You can't call a function without a valid frame. |
| 2286 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 2287 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
| 2287 | 2288 |
| 2288 // Get the function and setup the context. | 2289 // Get the function and setup the context. |
| 2289 LoadHeapObject(edi, function); | 2290 LoadHeapObject(edi, function); |
| 2290 mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 2291 mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
| 2291 | 2292 |
| 2292 ParameterCount expected(function->shared()->formal_parameter_count()); | |
| 2293 // We call indirectly through the code field in the function to | 2293 // We call indirectly through the code field in the function to |
| 2294 // allow recompilation to take effect without changing any of the | 2294 // allow recompilation to take effect without changing any of the |
| 2295 // call sites. | 2295 // call sites. |
| 2296 InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), | 2296 InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), |
| 2297 expected, actual, flag, call_wrapper, call_kind); | 2297 expected, actual, flag, call_wrapper, call_kind); |
| 2298 } | 2298 } |
| 2299 | 2299 |
| 2300 | 2300 |
| 2301 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, | 2301 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, |
| 2302 InvokeFlag flag, | 2302 InvokeFlag flag, |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2473 // The registers are pushed starting with the lowest encoding, | 2473 // The registers are pushed starting with the lowest encoding, |
| 2474 // which means that lowest encodings are furthest away from | 2474 // which means that lowest encodings are furthest away from |
| 2475 // the stack pointer. | 2475 // the stack pointer. |
| 2476 ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters); | 2476 ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters); |
| 2477 return kNumSafepointRegisters - reg_code - 1; | 2477 return kNumSafepointRegisters - reg_code - 1; |
| 2478 } | 2478 } |
| 2479 | 2479 |
| 2480 | 2480 |
| 2481 void MacroAssembler::LoadHeapObject(Register result, | 2481 void MacroAssembler::LoadHeapObject(Register result, |
| 2482 Handle<HeapObject> object) { | 2482 Handle<HeapObject> object) { |
| 2483 ALLOW_HANDLE_DEREF(isolate(), "embedding raw address"); |
| 2483 if (isolate()->heap()->InNewSpace(*object)) { | 2484 if (isolate()->heap()->InNewSpace(*object)) { |
| 2484 Handle<JSGlobalPropertyCell> cell = | 2485 Handle<JSGlobalPropertyCell> cell = |
| 2485 isolate()->factory()->NewJSGlobalPropertyCell(object); | 2486 isolate()->factory()->NewJSGlobalPropertyCell(object); |
| 2486 mov(result, Operand::Cell(cell)); | 2487 mov(result, Operand::Cell(cell)); |
| 2487 } else { | 2488 } else { |
| 2488 mov(result, object); | 2489 mov(result, object); |
| 2489 } | 2490 } |
| 2490 } | 2491 } |
| 2491 | 2492 |
| 2492 | 2493 |
| 2493 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { | 2494 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { |
| 2495 ALLOW_HANDLE_DEREF(isolate(), "using raw address"); |
| 2494 if (isolate()->heap()->InNewSpace(*object)) { | 2496 if (isolate()->heap()->InNewSpace(*object)) { |
| 2495 Handle<JSGlobalPropertyCell> cell = | 2497 Handle<JSGlobalPropertyCell> cell = |
| 2496 isolate()->factory()->NewJSGlobalPropertyCell(object); | 2498 isolate()->factory()->NewJSGlobalPropertyCell(object); |
| 2497 push(Operand::Cell(cell)); | 2499 push(Operand::Cell(cell)); |
| 2498 } else { | 2500 } else { |
| 2499 Push(object); | 2501 Push(object); |
| 2500 } | 2502 } |
| 2501 } | 2503 } |
| 2502 | 2504 |
| 2503 | 2505 |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3112 j(greater, &no_info_available); | 3114 j(greater, &no_info_available); |
| 3113 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 3115 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
| 3114 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); | 3116 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); |
| 3115 bind(&no_info_available); | 3117 bind(&no_info_available); |
| 3116 } | 3118 } |
| 3117 | 3119 |
| 3118 | 3120 |
| 3119 } } // namespace v8::internal | 3121 } } // namespace v8::internal |
| 3120 | 3122 |
| 3121 #endif // V8_TARGET_ARCH_IA32 | 3123 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |