| 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 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2027 | 2027 |
| 2028 ParameterCount expected(function->shared()->formal_parameter_count()); | 2028 ParameterCount expected(function->shared()->formal_parameter_count()); |
| 2029 // We call indirectly through the code field in the function to | 2029 // We call indirectly through the code field in the function to |
| 2030 // allow recompilation to take effect without changing any of the | 2030 // allow recompilation to take effect without changing any of the |
| 2031 // call sites. | 2031 // call sites. |
| 2032 InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), | 2032 InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), |
| 2033 expected, actual, flag, call_wrapper, call_kind); | 2033 expected, actual, flag, call_wrapper, call_kind); |
| 2034 } | 2034 } |
| 2035 | 2035 |
| 2036 | 2036 |
| 2037 void MacroAssembler::InvokeConstruct(Register fun, |
| 2038 const ParameterCount& actual) { |
| 2039 // Load argument count into eax. |
| 2040 if (actual.is_immediate()) { |
| 2041 SafeSet(eax, Immediate(actual.immediate())); |
| 2042 } else { |
| 2043 ASSERT(actual.reg().is(eax)); |
| 2044 } |
| 2045 |
| 2046 // Dispatch to the function-specific construct stub. |
| 2047 ASSERT(fun.is(edi)); |
| 2048 mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 2049 mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kConstructStubOffset)); |
| 2050 lea(ebx, FieldOperand(ebx, Code::kHeaderSize)); |
| 2051 jmp(ebx); |
| 2052 } |
| 2053 |
| 2054 |
| 2055 void MacroAssembler::InvokeConstruct(Handle<JSFunction> function, |
| 2056 const ParameterCount& actual) { |
| 2057 // Get the function and setup the context. |
| 2058 mov(edi, Immediate(function)); |
| 2059 mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
| 2060 |
| 2061 // Load argument count into eax. |
| 2062 if (actual.is_immediate()) { |
| 2063 SafeSet(eax, Immediate(actual.immediate())); |
| 2064 } else { |
| 2065 ASSERT(actual.reg().is(eax)); |
| 2066 } |
| 2067 |
| 2068 // Dispatch to the function-specific construct stub. |
| 2069 mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 2070 mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kConstructStubOffset)); |
| 2071 lea(ebx, FieldOperand(ebx, Code::kHeaderSize)); |
| 2072 jmp(ebx); |
| 2073 } |
| 2074 |
| 2075 |
| 2037 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, | 2076 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, |
| 2038 InvokeFlag flag, | 2077 InvokeFlag flag, |
| 2039 const CallWrapper& call_wrapper) { | 2078 const CallWrapper& call_wrapper) { |
| 2040 // You can't call a builtin without a valid frame. | 2079 // You can't call a builtin without a valid frame. |
| 2041 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 2080 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
| 2042 | 2081 |
| 2043 // Rely on the assertion to check that the number of provided | 2082 // Rely on the assertion to check that the number of provided |
| 2044 // arguments match the expected number of arguments. Fake a | 2083 // arguments match the expected number of arguments. Fake a |
| 2045 // parameter count to avoid emitting code to do the check. | 2084 // parameter count to avoid emitting code to do the check. |
| 2046 ParameterCount expected(0); | 2085 ParameterCount expected(0); |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2659 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2698 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
| 2660 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2699 Check(less_equal, "Live Bytes Count overflow chunk size"); |
| 2661 } | 2700 } |
| 2662 | 2701 |
| 2663 bind(&done); | 2702 bind(&done); |
| 2664 } | 2703 } |
| 2665 | 2704 |
| 2666 } } // namespace v8::internal | 2705 } } // namespace v8::internal |
| 2667 | 2706 |
| 2668 #endif // V8_TARGET_ARCH_IA32 | 2707 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |