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

Side by Side Diff: src/hydrogen.cc

Issue 9117034: New class for Date objects: caches individual date components. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add constant for index of first barrier-free slot. Created 8 years, 11 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
« no previous file with comments | « src/date.js ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6546 matching lines...) Expand 10 before | Expand all | Expand 10 after
6557 6557
6558 void HGraphBuilder::GenerateValueOf(CallRuntime* call) { 6558 void HGraphBuilder::GenerateValueOf(CallRuntime* call) {
6559 ASSERT(call->arguments()->length() == 1); 6559 ASSERT(call->arguments()->length() == 1);
6560 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 6560 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
6561 HValue* value = Pop(); 6561 HValue* value = Pop();
6562 HValueOf* result = new(zone()) HValueOf(value); 6562 HValueOf* result = new(zone()) HValueOf(value);
6563 return ast_context()->ReturnInstruction(result, call->id()); 6563 return ast_context()->ReturnInstruction(result, call->id());
6564 } 6564 }
6565 6565
6566 6566
6567 void HGraphBuilder::GenerateDateField(CallRuntime* call) {
6568 ASSERT(call->arguments()->length() == 2);
6569 ASSERT_NE(NULL, call->arguments()->at(1)->AsLiteral());
6570 int index =
6571 Smi::cast(*(call->arguments()->at(1)->AsLiteral()->handle()))->value();
6572 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
6573 HValue* date = Pop();
6574 HDateField* result = new(zone()) HDateField(date, index);
6575 return ast_context()->ReturnInstruction(result, call->id());
6576 }
6577
6578
6567 void HGraphBuilder::GenerateSetValueOf(CallRuntime* call) { 6579 void HGraphBuilder::GenerateSetValueOf(CallRuntime* call) {
6568 ASSERT(call->arguments()->length() == 2); 6580 ASSERT(call->arguments()->length() == 2);
6569 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 6581 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
6570 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); 6582 CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
6571 HValue* value = Pop(); 6583 HValue* value = Pop();
6572 HValue* object = Pop(); 6584 HValue* object = Pop();
6573 // Check if object is a not a smi. 6585 // Check if object is a not a smi.
6574 HIsSmiAndBranch* smicheck = new(zone()) HIsSmiAndBranch(object); 6586 HIsSmiAndBranch* smicheck = new(zone()) HIsSmiAndBranch(object);
6575 HBasicBlock* if_smi = graph()->CreateBasicBlock(); 6587 HBasicBlock* if_smi = graph()->CreateBasicBlock();
6576 HBasicBlock* if_heap_object = graph()->CreateBasicBlock(); 6588 HBasicBlock* if_heap_object = graph()->CreateBasicBlock();
(...skipping 22 matching lines...) Expand all
6599 value, 6611 value,
6600 true, // in-object store. 6612 true, // in-object store.
6601 JSValue::kValueOffset)); 6613 JSValue::kValueOffset));
6602 if_js_value->Goto(join); 6614 if_js_value->Goto(join);
6603 join->SetJoinId(call->id()); 6615 join->SetJoinId(call->id());
6604 set_current_block(join); 6616 set_current_block(join);
6605 return ast_context()->ReturnValue(value); 6617 return ast_context()->ReturnValue(value);
6606 } 6618 }
6607 6619
6608 6620
6621 void HGraphBuilder::GenerateSetDateField(CallRuntime* call) {
6622 ASSERT(call->arguments()->length() == 3);
6623 ASSERT_NE(NULL, call->arguments()->at(1)->AsLiteral());
6624 int index =
6625 Smi::cast(*(call->arguments()->at(1)->AsLiteral()->handle()))->value();
6626 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
6627 CHECK_ALIVE(VisitForValue(call->arguments()->at(2)));
6628 HValue* value = Pop();
6629 HValue* date = Pop();
6630 HValue* context = environment()->LookupContext();
6631 HSetDateField* result =
6632 new(zone()) HSetDateField(context, date, value, index);
6633 return ast_context()->ReturnInstruction(result, call->id());
6634 }
6635
6636
6609 // Fast support for charCodeAt(n). 6637 // Fast support for charCodeAt(n).
6610 void HGraphBuilder::GenerateStringCharCodeAt(CallRuntime* call) { 6638 void HGraphBuilder::GenerateStringCharCodeAt(CallRuntime* call) {
6611 ASSERT(call->arguments()->length() == 2); 6639 ASSERT(call->arguments()->length() == 2);
6612 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 6640 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
6613 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); 6641 CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
6614 HValue* index = Pop(); 6642 HValue* index = Pop();
6615 HValue* string = Pop(); 6643 HValue* string = Pop();
6616 HValue* context = environment()->LookupContext(); 6644 HValue* context = environment()->LookupContext();
6617 HStringCharCodeAt* result = BuildStringCharCodeAt(context, string, index); 6645 HStringCharCodeAt* result = BuildStringCharCodeAt(context, string, index);
6618 return ast_context()->ReturnInstruction(result, call->id()); 6646 return ast_context()->ReturnInstruction(result, call->id());
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
7450 } 7478 }
7451 } 7479 }
7452 7480
7453 #ifdef DEBUG 7481 #ifdef DEBUG
7454 if (graph_ != NULL) graph_->Verify(false); // No full verify. 7482 if (graph_ != NULL) graph_->Verify(false); // No full verify.
7455 if (allocator_ != NULL) allocator_->Verify(); 7483 if (allocator_ != NULL) allocator_->Verify();
7456 #endif 7484 #endif
7457 } 7485 }
7458 7486
7459 } } // namespace v8::internal 7487 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/date.js ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698