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 2287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2298 ZoneList<Expression*>* args = expr->arguments(); | 2298 ZoneList<Expression*>* args = expr->arguments(); |
2299 int arg_count = args->length(); | 2299 int arg_count = args->length(); |
2300 { PreservePositionScope scope(masm()->positions_recorder()); | 2300 { PreservePositionScope scope(masm()->positions_recorder()); |
2301 for (int i = 0; i < arg_count; i++) { | 2301 for (int i = 0; i < arg_count; i++) { |
2302 VisitForStackValue(args->at(i)); | 2302 VisitForStackValue(args->at(i)); |
2303 } | 2303 } |
2304 } | 2304 } |
2305 // Record source position for debugger. | 2305 // Record source position for debugger. |
2306 SetSourcePosition(expr->position()); | 2306 SetSourcePosition(expr->position()); |
2307 | 2307 |
2308 // Record call targets in unoptimized code, but not in the snapshot. | 2308 // Record call targets in unoptimized code. |
2309 if (!Serializer::enabled()) { | 2309 flags = static_cast<CallFunctionFlags>(flags | RECORD_CALL_TARGET); |
2310 flags = static_cast<CallFunctionFlags>(flags | RECORD_CALL_TARGET); | 2310 Handle<Object> uninitialized = |
2311 Handle<Object> uninitialized = | 2311 TypeFeedbackCells::UninitializedSentinel(isolate()); |
2312 TypeFeedbackCells::UninitializedSentinel(isolate()); | 2312 Handle<JSGlobalPropertyCell> cell = |
2313 Handle<JSGlobalPropertyCell> cell = | 2313 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized); |
2314 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized); | 2314 RecordTypeFeedbackCell(expr->id(), cell); |
2315 RecordTypeFeedbackCell(expr->id(), cell); | 2315 __ mov(ebx, cell); |
2316 __ mov(ebx, cell); | |
2317 } | |
2318 | 2316 |
2319 CallFunctionStub stub(arg_count, flags); | 2317 CallFunctionStub stub(arg_count, flags); |
2320 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); | 2318 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); |
2321 __ CallStub(&stub, expr->id()); | 2319 __ CallStub(&stub, expr->id()); |
2322 | 2320 |
2323 RecordJSReturnSite(expr); | 2321 RecordJSReturnSite(expr); |
2324 // Restore context register. | 2322 // Restore context register. |
2325 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 2323 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
2326 context()->DropAndPlug(1, eax); | 2324 context()->DropAndPlug(1, eax); |
2327 } | 2325 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2486 } | 2484 } |
2487 | 2485 |
2488 // Call the construct call builtin that handles allocation and | 2486 // Call the construct call builtin that handles allocation and |
2489 // constructor invocation. | 2487 // constructor invocation. |
2490 SetSourcePosition(expr->position()); | 2488 SetSourcePosition(expr->position()); |
2491 | 2489 |
2492 // Load function and argument count into edi and eax. | 2490 // Load function and argument count into edi and eax. |
2493 __ Set(eax, Immediate(arg_count)); | 2491 __ Set(eax, Immediate(arg_count)); |
2494 __ mov(edi, Operand(esp, arg_count * kPointerSize)); | 2492 __ mov(edi, Operand(esp, arg_count * kPointerSize)); |
2495 | 2493 |
2496 // Record call targets in unoptimized code, but not in the snapshot. | 2494 // Record call targets in unoptimized code. |
2497 CallFunctionFlags flags; | 2495 CallFunctionFlags flags = RECORD_CALL_TARGET; |
Jakob Kummerow
2012/07/31 09:02:08
nit: This variable is only used once (line 2503),
| |
2498 if (!Serializer::enabled()) { | 2496 Handle<Object> uninitialized = |
2499 flags = RECORD_CALL_TARGET; | 2497 TypeFeedbackCells::UninitializedSentinel(isolate()); |
2500 Handle<Object> uninitialized = | 2498 Handle<JSGlobalPropertyCell> cell = |
2501 TypeFeedbackCells::UninitializedSentinel(isolate()); | 2499 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized); |
2502 Handle<JSGlobalPropertyCell> cell = | 2500 RecordTypeFeedbackCell(expr->id(), cell); |
2503 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized); | 2501 __ mov(ebx, cell); |
2504 RecordTypeFeedbackCell(expr->id(), cell); | |
2505 __ mov(ebx, cell); | |
2506 } else { | |
2507 flags = NO_CALL_FUNCTION_FLAGS; | |
2508 } | |
2509 | 2502 |
2510 CallConstructStub stub(flags); | 2503 CallConstructStub stub(flags); |
2511 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 2504 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
2512 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 2505 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
2513 context()->Plug(eax); | 2506 context()->Plug(eax); |
2514 } | 2507 } |
2515 | 2508 |
2516 | 2509 |
2517 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2510 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
2518 ZoneList<Expression*>* args = expr->arguments(); | 2511 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4549 *stack_depth = 0; | 4542 *stack_depth = 0; |
4550 *context_length = 0; | 4543 *context_length = 0; |
4551 return previous_; | 4544 return previous_; |
4552 } | 4545 } |
4553 | 4546 |
4554 #undef __ | 4547 #undef __ |
4555 | 4548 |
4556 } } // namespace v8::internal | 4549 } } // namespace v8::internal |
4557 | 4550 |
4558 #endif // V8_TARGET_ARCH_IA32 | 4551 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |