Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: src/mips/full-codegen-mips.cc

Issue 10824084: Fix deserializer to understand direct pointers from code to cell payloads. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 ZoneList<Expression*>* args = expr->arguments(); 2382 ZoneList<Expression*>* args = expr->arguments();
2383 int arg_count = args->length(); 2383 int arg_count = args->length();
2384 { PreservePositionScope scope(masm()->positions_recorder()); 2384 { PreservePositionScope scope(masm()->positions_recorder());
2385 for (int i = 0; i < arg_count; i++) { 2385 for (int i = 0; i < arg_count; i++) {
2386 VisitForStackValue(args->at(i)); 2386 VisitForStackValue(args->at(i));
2387 } 2387 }
2388 } 2388 }
2389 // Record source position for debugger. 2389 // Record source position for debugger.
2390 SetSourcePosition(expr->position()); 2390 SetSourcePosition(expr->position());
2391 2391
2392 // Record call targets in unoptimized code, but not in the snapshot. 2392 // Record call targets.
2393 if (!Serializer::enabled()) { 2393 flags = static_cast<CallFunctionFlags>(flags | RECORD_CALL_TARGET);
2394 flags = static_cast<CallFunctionFlags>(flags | RECORD_CALL_TARGET); 2394 Handle<Object> uninitialized =
2395 Handle<Object> uninitialized = 2395 TypeFeedbackCells::UninitializedSentinel(isolate());
2396 TypeFeedbackCells::UninitializedSentinel(isolate()); 2396 Handle<JSGlobalPropertyCell> cell =
2397 Handle<JSGlobalPropertyCell> cell = 2397 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized);
2398 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized); 2398 RecordTypeFeedbackCell(expr->id(), cell);
2399 RecordTypeFeedbackCell(expr->id(), cell); 2399 __ li(a2, Operand(cell));
2400 __ li(a2, Operand(cell));
2401 }
2402 2400
2403 CallFunctionStub stub(arg_count, flags); 2401 CallFunctionStub stub(arg_count, flags);
2404 __ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); 2402 __ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize));
2405 __ CallStub(&stub); 2403 __ CallStub(&stub);
2406 RecordJSReturnSite(expr); 2404 RecordJSReturnSite(expr);
2407 // Restore context register. 2405 // Restore context register.
2408 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2406 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2409 context()->DropAndPlug(1, v0); 2407 context()->DropAndPlug(1, v0);
2410 } 2408 }
2411 2409
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2580 } 2578 }
2581 2579
2582 // Call the construct call builtin that handles allocation and 2580 // Call the construct call builtin that handles allocation and
2583 // constructor invocation. 2581 // constructor invocation.
2584 SetSourcePosition(expr->position()); 2582 SetSourcePosition(expr->position());
2585 2583
2586 // Load function and argument count into a1 and a0. 2584 // Load function and argument count into a1 and a0.
2587 __ li(a0, Operand(arg_count)); 2585 __ li(a0, Operand(arg_count));
2588 __ lw(a1, MemOperand(sp, arg_count * kPointerSize)); 2586 __ lw(a1, MemOperand(sp, arg_count * kPointerSize));
2589 2587
2590 // Record call targets in unoptimized code, but not in the snapshot. 2588 // Record call targets in unoptimized code.
2591 CallFunctionFlags flags; 2589 Handle<Object> uninitialized =
2592 if (!Serializer::enabled()) { 2590 TypeFeedbackCells::UninitializedSentinel(isolate());
2593 flags = RECORD_CALL_TARGET; 2591 Handle<JSGlobalPropertyCell> cell =
2594 Handle<Object> uninitialized = 2592 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized);
2595 TypeFeedbackCells::UninitializedSentinel(isolate()); 2593 RecordTypeFeedbackCell(expr->id(), cell);
2596 Handle<JSGlobalPropertyCell> cell = 2594 __ li(a2, Operand(cell));
2597 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized);
2598 RecordTypeFeedbackCell(expr->id(), cell);
2599 __ li(a2, Operand(cell));
2600 } else {
2601 flags = NO_CALL_FUNCTION_FLAGS;
2602 }
2603 2595
2604 CallConstructStub stub(flags); 2596 CallConstructStub stub(RECORD_CALL_TARGET);
2605 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); 2597 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
2606 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); 2598 PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
2607 context()->Plug(v0); 2599 context()->Plug(v0);
2608 } 2600 }
2609 2601
2610 2602
2611 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { 2603 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
2612 ZoneList<Expression*>* args = expr->arguments(); 2604 ZoneList<Expression*>* args = expr->arguments();
2613 ASSERT(args->length() == 1); 2605 ASSERT(args->length() == 1);
2614 2606
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after
4615 *context_length = 0; 4607 *context_length = 0;
4616 return previous_; 4608 return previous_;
4617 } 4609 }
4618 4610
4619 4611
4620 #undef __ 4612 #undef __
4621 4613
4622 } } // namespace v8::internal 4614 } } // namespace v8::internal
4623 4615
4624 #endif // V8_TARGET_ARCH_MIPS 4616 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698