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

Side by Side Diff: src/hydrogen.cc

Issue 9572008: Implement date library functions in C++. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Bug fixes. Created 8 years, 9 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 7100 matching lines...) Expand 10 before | Expand all | Expand 10 after
7111 7111
7112 void HGraphBuilder::GenerateValueOf(CallRuntime* call) { 7112 void HGraphBuilder::GenerateValueOf(CallRuntime* call) {
7113 ASSERT(call->arguments()->length() == 1); 7113 ASSERT(call->arguments()->length() == 1);
7114 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 7114 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
7115 HValue* value = Pop(); 7115 HValue* value = Pop();
7116 HValueOf* result = new(zone()) HValueOf(value); 7116 HValueOf* result = new(zone()) HValueOf(value);
7117 return ast_context()->ReturnInstruction(result, call->id()); 7117 return ast_context()->ReturnInstruction(result, call->id());
7118 } 7118 }
7119 7119
7120 7120
7121 void HGraphBuilder::GenerateDateField(CallRuntime* call) {
7122 ASSERT(call->arguments()->length() == 2);
7123 ASSERT_NE(NULL, call->arguments()->at(1)->AsLiteral());
7124 Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->handle()));
7125 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
7126 HValue* date = Pop();
7127 HDateField* result = new(zone()) HDateField(date, index);
7128 return ast_context()->ReturnInstruction(result, call->id());
7129 }
7130
7131
7121 void HGraphBuilder::GenerateSetValueOf(CallRuntime* call) { 7132 void HGraphBuilder::GenerateSetValueOf(CallRuntime* call) {
7122 ASSERT(call->arguments()->length() == 2); 7133 ASSERT(call->arguments()->length() == 2);
7123 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 7134 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
7124 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); 7135 CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
7125 HValue* value = Pop(); 7136 HValue* value = Pop();
7126 HValue* object = Pop(); 7137 HValue* object = Pop();
7127 // Check if object is a not a smi. 7138 // Check if object is a not a smi.
7128 HIsSmiAndBranch* smicheck = new(zone()) HIsSmiAndBranch(object); 7139 HIsSmiAndBranch* smicheck = new(zone()) HIsSmiAndBranch(object);
7129 HBasicBlock* if_smi = graph()->CreateBasicBlock(); 7140 HBasicBlock* if_smi = graph()->CreateBasicBlock();
7130 HBasicBlock* if_heap_object = graph()->CreateBasicBlock(); 7141 HBasicBlock* if_heap_object = graph()->CreateBasicBlock();
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
8027 } 8038 }
8028 } 8039 }
8029 8040
8030 #ifdef DEBUG 8041 #ifdef DEBUG
8031 if (graph_ != NULL) graph_->Verify(false); // No full verify. 8042 if (graph_ != NULL) graph_->Verify(false); // No full verify.
8032 if (allocator_ != NULL) allocator_->Verify(); 8043 if (allocator_ != NULL) allocator_->Verify();
8033 #endif 8044 #endif
8034 } 8045 }
8035 8046
8036 } } // namespace v8::internal 8047 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698