Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2383 | 2383 |
| 2384 int arity = instr->arity(); | 2384 int arity = instr->arity(); |
| 2385 Handle<Code> ic = StubCache::ComputeCallInitialize(arity, NOT_IN_LOOP); | 2385 Handle<Code> ic = StubCache::ComputeCallInitialize(arity, NOT_IN_LOOP); |
| 2386 __ mov(ecx, instr->name()); | 2386 __ mov(ecx, instr->name()); |
| 2387 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); | 2387 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); |
| 2388 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 2388 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 2389 } | 2389 } |
| 2390 | 2390 |
| 2391 | 2391 |
| 2392 void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) { | 2392 void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) { |
| 2393 ASSERT(ToRegister(instr->input()).is(eax)); | |
| 2393 ASSERT(ToRegister(instr->result()).is(eax)); | 2394 ASSERT(ToRegister(instr->result()).is(eax)); |
| 2394 __ mov(edi, instr->target()); | 2395 |
| 2395 CallKnownFunction(instr->target(), instr->arity(), instr); | 2396 // The receiver slot in the outgoing arguments holds the global object, |
| 2397 // because that's what the unoptimized code expects if we deoptimize the | |
| 2398 // argument subexpressions. Patch it to the global receiver before making | |
| 2399 // the call. | |
| 2400 int arity = instr->arity(); // Arity does not include receiver. | |
| 2401 __ mov(Operand(esp, arity * kPointerSize), eax); | |
|
fschneider
2010/12/20 16:13:02
It would be nice to avoid patching in the global r
| |
| 2402 | |
| 2403 Handle<JSFunction> target = instr->target(); | |
| 2404 __ mov(edi, target); | |
| 2405 CallKnownFunction(target, arity, instr); | |
| 2396 } | 2406 } |
| 2397 | 2407 |
| 2398 | 2408 |
| 2399 void LCodeGen::DoCallNew(LCallNew* instr) { | 2409 void LCodeGen::DoCallNew(LCallNew* instr) { |
| 2400 ASSERT(ToRegister(instr->input()).is(edi)); | 2410 ASSERT(ToRegister(instr->input()).is(edi)); |
| 2401 ASSERT(ToRegister(instr->result()).is(eax)); | 2411 ASSERT(ToRegister(instr->result()).is(eax)); |
| 2402 | 2412 |
| 2403 Handle<Code> builtin(Builtins::builtin(Builtins::JSConstructCall)); | 2413 Handle<Code> builtin(Builtins::builtin(Builtins::JSConstructCall)); |
| 2404 __ Set(eax, Immediate(instr->arity())); | 2414 __ Set(eax, Immediate(instr->arity())); |
| 2405 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr); | 2415 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr); |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3243 ASSERT(!environment->HasBeenRegistered()); | 3253 ASSERT(!environment->HasBeenRegistered()); |
| 3244 RegisterEnvironmentForDeoptimization(environment); | 3254 RegisterEnvironmentForDeoptimization(environment); |
| 3245 ASSERT(osr_pc_offset_ == -1); | 3255 ASSERT(osr_pc_offset_ == -1); |
| 3246 osr_pc_offset_ = masm()->pc_offset(); | 3256 osr_pc_offset_ = masm()->pc_offset(); |
| 3247 } | 3257 } |
| 3248 | 3258 |
| 3249 | 3259 |
| 3250 #undef __ | 3260 #undef __ |
| 3251 | 3261 |
| 3252 } } // namespace v8::internal | 3262 } } // namespace v8::internal |
| OLD | NEW |