| 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 7107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7118 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 7118 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 7119 HValue* value = Pop(); | 7119 HValue* value = Pop(); |
| 7120 HValueOf* result = new(zone()) HValueOf(value); | 7120 HValueOf* result = new(zone()) HValueOf(value); |
| 7121 return ast_context()->ReturnInstruction(result, call->id()); | 7121 return ast_context()->ReturnInstruction(result, call->id()); |
| 7122 } | 7122 } |
| 7123 | 7123 |
| 7124 | 7124 |
| 7125 void HGraphBuilder::GenerateDateField(CallRuntime* call) { | 7125 void HGraphBuilder::GenerateDateField(CallRuntime* call) { |
| 7126 ASSERT(call->arguments()->length() == 2); | 7126 ASSERT(call->arguments()->length() == 2); |
| 7127 ASSERT_NE(NULL, call->arguments()->at(1)->AsLiteral()); | 7127 ASSERT_NE(NULL, call->arguments()->at(1)->AsLiteral()); |
| 7128 int index = | 7128 Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->handle())); |
| 7129 Smi::cast(*(call->arguments()->at(1)->AsLiteral()->handle()))->value(); | |
| 7130 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 7129 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 7131 HValue* date = Pop(); | 7130 HValue* date = Pop(); |
| 7132 HDateField* result = new(zone()) HDateField(date, index); | 7131 HDateField* result = new(zone()) HDateField(date, index); |
| 7133 return ast_context()->ReturnInstruction(result, call->id()); | 7132 return ast_context()->ReturnInstruction(result, call->id()); |
| 7134 } | 7133 } |
| 7135 | 7134 |
| 7136 | 7135 |
| 7137 void HGraphBuilder::GenerateSetValueOf(CallRuntime* call) { | 7136 void HGraphBuilder::GenerateSetValueOf(CallRuntime* call) { |
| 7138 ASSERT(call->arguments()->length() == 2); | 7137 ASSERT(call->arguments()->length() == 2); |
| 7139 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 7138 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 7169 value, | 7168 value, |
| 7170 true, // in-object store. | 7169 true, // in-object store. |
| 7171 JSValue::kValueOffset)); | 7170 JSValue::kValueOffset)); |
| 7172 if_js_value->Goto(join); | 7171 if_js_value->Goto(join); |
| 7173 join->SetJoinId(call->id()); | 7172 join->SetJoinId(call->id()); |
| 7174 set_current_block(join); | 7173 set_current_block(join); |
| 7175 return ast_context()->ReturnValue(value); | 7174 return ast_context()->ReturnValue(value); |
| 7176 } | 7175 } |
| 7177 | 7176 |
| 7178 | 7177 |
| 7179 void HGraphBuilder::GenerateSetDateField(CallRuntime* call) { | |
| 7180 ASSERT(call->arguments()->length() == 3); | |
| 7181 ASSERT_NE(NULL, call->arguments()->at(1)->AsLiteral()); | |
| 7182 int index = | |
| 7183 Smi::cast(*(call->arguments()->at(1)->AsLiteral()->handle()))->value(); | |
| 7184 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | |
| 7185 CHECK_ALIVE(VisitForValue(call->arguments()->at(2))); | |
| 7186 HValue* value = Pop(); | |
| 7187 HValue* date = Pop(); | |
| 7188 HValue* context = environment()->LookupContext(); | |
| 7189 HSetDateField* result = | |
| 7190 new(zone()) HSetDateField(context, date, value, index); | |
| 7191 return ast_context()->ReturnInstruction(result, call->id()); | |
| 7192 } | |
| 7193 | |
| 7194 | |
| 7195 // Fast support for charCodeAt(n). | 7178 // Fast support for charCodeAt(n). |
| 7196 void HGraphBuilder::GenerateStringCharCodeAt(CallRuntime* call) { | 7179 void HGraphBuilder::GenerateStringCharCodeAt(CallRuntime* call) { |
| 7197 ASSERT(call->arguments()->length() == 2); | 7180 ASSERT(call->arguments()->length() == 2); |
| 7198 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 7181 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 7199 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); | 7182 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); |
| 7200 HValue* index = Pop(); | 7183 HValue* index = Pop(); |
| 7201 HValue* string = Pop(); | 7184 HValue* string = Pop(); |
| 7202 HValue* context = environment()->LookupContext(); | 7185 HValue* context = environment()->LookupContext(); |
| 7203 HStringCharCodeAt* result = BuildStringCharCodeAt(context, string, index); | 7186 HStringCharCodeAt* result = BuildStringCharCodeAt(context, string, index); |
| 7204 return ast_context()->ReturnInstruction(result, call->id()); | 7187 return ast_context()->ReturnInstruction(result, call->id()); |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8062 } | 8045 } |
| 8063 } | 8046 } |
| 8064 | 8047 |
| 8065 #ifdef DEBUG | 8048 #ifdef DEBUG |
| 8066 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 8049 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 8067 if (allocator_ != NULL) allocator_->Verify(); | 8050 if (allocator_ != NULL) allocator_->Verify(); |
| 8068 #endif | 8051 #endif |
| 8069 } | 8052 } |
| 8070 | 8053 |
| 8071 } } // namespace v8::internal | 8054 } } // namespace v8::internal |
| OLD | NEW |