| 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 7100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 int index = |
| 7125 Smi::cast(*(call->arguments()->at(1)->AsLiteral()->handle()))->value(); |
| 7126 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 7127 HValue* date = Pop(); |
| 7128 HDateField* result = new(zone()) HDateField(date, index); |
| 7129 return ast_context()->ReturnInstruction(result, call->id()); |
| 7130 } |
| 7131 |
| 7132 |
| 7121 void HGraphBuilder::GenerateSetValueOf(CallRuntime* call) { | 7133 void HGraphBuilder::GenerateSetValueOf(CallRuntime* call) { |
| 7122 ASSERT(call->arguments()->length() == 2); | 7134 ASSERT(call->arguments()->length() == 2); |
| 7123 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 7135 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 7124 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); | 7136 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); |
| 7125 HValue* value = Pop(); | 7137 HValue* value = Pop(); |
| 7126 HValue* object = Pop(); | 7138 HValue* object = Pop(); |
| 7127 // Check if object is a not a smi. | 7139 // Check if object is a not a smi. |
| 7128 HIsSmiAndBranch* smicheck = new(zone()) HIsSmiAndBranch(object); | 7140 HIsSmiAndBranch* smicheck = new(zone()) HIsSmiAndBranch(object); |
| 7129 HBasicBlock* if_smi = graph()->CreateBasicBlock(); | 7141 HBasicBlock* if_smi = graph()->CreateBasicBlock(); |
| 7130 HBasicBlock* if_heap_object = graph()->CreateBasicBlock(); | 7142 HBasicBlock* if_heap_object = graph()->CreateBasicBlock(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 7153 value, | 7165 value, |
| 7154 true, // in-object store. | 7166 true, // in-object store. |
| 7155 JSValue::kValueOffset)); | 7167 JSValue::kValueOffset)); |
| 7156 if_js_value->Goto(join); | 7168 if_js_value->Goto(join); |
| 7157 join->SetJoinId(call->id()); | 7169 join->SetJoinId(call->id()); |
| 7158 set_current_block(join); | 7170 set_current_block(join); |
| 7159 return ast_context()->ReturnValue(value); | 7171 return ast_context()->ReturnValue(value); |
| 7160 } | 7172 } |
| 7161 | 7173 |
| 7162 | 7174 |
| 7175 void HGraphBuilder::GenerateSetDateField(CallRuntime* call) { |
| 7176 ASSERT(call->arguments()->length() == 3); |
| 7177 ASSERT_NE(NULL, call->arguments()->at(1)->AsLiteral()); |
| 7178 int index = |
| 7179 Smi::cast(*(call->arguments()->at(1)->AsLiteral()->handle()))->value(); |
| 7180 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 7181 CHECK_ALIVE(VisitForValue(call->arguments()->at(2))); |
| 7182 HValue* value = Pop(); |
| 7183 HValue* date = Pop(); |
| 7184 HValue* context = environment()->LookupContext(); |
| 7185 HSetDateField* result = |
| 7186 new(zone()) HSetDateField(context, date, value, index); |
| 7187 return ast_context()->ReturnInstruction(result, call->id()); |
| 7188 } |
| 7189 |
| 7190 |
| 7163 // Fast support for charCodeAt(n). | 7191 // Fast support for charCodeAt(n). |
| 7164 void HGraphBuilder::GenerateStringCharCodeAt(CallRuntime* call) { | 7192 void HGraphBuilder::GenerateStringCharCodeAt(CallRuntime* call) { |
| 7165 ASSERT(call->arguments()->length() == 2); | 7193 ASSERT(call->arguments()->length() == 2); |
| 7166 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 7194 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 7167 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); | 7195 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); |
| 7168 HValue* index = Pop(); | 7196 HValue* index = Pop(); |
| 7169 HValue* string = Pop(); | 7197 HValue* string = Pop(); |
| 7170 HValue* context = environment()->LookupContext(); | 7198 HValue* context = environment()->LookupContext(); |
| 7171 HStringCharCodeAt* result = BuildStringCharCodeAt(context, string, index); | 7199 HStringCharCodeAt* result = BuildStringCharCodeAt(context, string, index); |
| 7172 return ast_context()->ReturnInstruction(result, call->id()); | 7200 return ast_context()->ReturnInstruction(result, call->id()); |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8027 } | 8055 } |
| 8028 } | 8056 } |
| 8029 | 8057 |
| 8030 #ifdef DEBUG | 8058 #ifdef DEBUG |
| 8031 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 8059 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 8032 if (allocator_ != NULL) allocator_->Verify(); | 8060 if (allocator_ != NULL) allocator_->Verify(); |
| 8033 #endif | 8061 #endif |
| 8034 } | 8062 } |
| 8035 | 8063 |
| 8036 } } // namespace v8::internal | 8064 } } // namespace v8::internal |
| OLD | NEW |