You may be okay, but you are at risk. You need to meet with an immigration lawyer to discuss your options. See the link below to the American Immigration Lawyers Association.First, you are probably out of either H or L status. If you are an H and can find new employment quickly, your new employer can file a new H petition for you, and you may be able to either extend your status or obtain a new H visa. If the 180 days goes by without a decision and the I-140 is determined approvable, then you may go to work for a new employer on a green card basis so long as the new job is in the same or a similar job classification. If you can't go to work with your old employer upon approval of your green card, you need to be able to "port" to a new employer in order to comply with immigration law. If your old employer would employ you, even for a short while, upon the receipt of the green card, you would most likely be okay. You are currently authorized to be in the US because of your pending I-485, but you are not authorized to work until you either obtain your EAD based on your I-485 filing, or, maybe, you find a new H-1B employer and that employer files a petition for you.
Your I-140 depends on your continued employment with the company, since the company is your petitioner and sponsor. If they no longer have a job offer for you, the I-140 is no good either. You should consult with an immigration attorney on this matter.
Contact immigration attorney Gintare Grigaite at 646-407-2331. Answers on AVVO do not constitute legal advice and do not form attorney-client relationship. Always consult an attorney for a legal advice.
Attorney at Law
Certified Specialist - Immigration and Nationality Law
State Bar of California - Board of Legal Specialization
Main office: Las Vegas, Nevada
Reza Athari & Associates, Pllc
3365 Pepper Lane, Suite 102
Las Vegas, NV 89120
Telephone: (702) 727-7777
Fax: (702) 458-8508
Toll free: (800) 565-2030