| 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 } | 427 } |
| 428 | 428 |
| 429 | 429 |
| 430 Handle<Code> FastCloneShallowArrayStub::GenerateCode(Isolate* isolate) { | 430 Handle<Code> FastCloneShallowArrayStub::GenerateCode(Isolate* isolate) { |
| 431 return DoGenerateCode(isolate, this); | 431 return DoGenerateCode(isolate, this); |
| 432 } | 432 } |
| 433 | 433 |
| 434 | 434 |
| 435 template <> | 435 template <> |
| 436 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() { | 436 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() { |
| 437 Zone* zone = this->zone(); | |
| 438 HValue* undefined = graph()->GetConstantUndefined(); | 437 HValue* undefined = graph()->GetConstantUndefined(); |
| 439 | 438 |
| 440 HInstruction* boilerplate = Add<HLoadKeyed>(GetParameter(0), | 439 HInstruction* boilerplate = Add<HLoadKeyed>(GetParameter(0), |
| 441 GetParameter(1), | 440 GetParameter(1), |
| 442 static_cast<HValue*>(NULL), | 441 static_cast<HValue*>(NULL), |
| 443 FAST_ELEMENTS); | 442 FAST_ELEMENTS); |
| 444 | 443 |
| 445 IfBuilder checker(this); | 444 IfBuilder checker(this); |
| 446 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(boilerplate, | 445 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(boilerplate, |
| 447 undefined); | 446 undefined); |
| 448 checker.And(); | 447 checker.And(); |
| 449 | 448 |
| 450 int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize; | 449 int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize; |
| 451 HValue* boilerplate_size = | 450 HValue* boilerplate_map = Add<HLoadNamedField>( |
| 452 AddInstruction(new(zone) HInstanceSize(boilerplate)); | 451 boilerplate, HObjectAccess::ForMap()); |
| 452 HValue* boilerplate_size = Add<HLoadNamedField>( |
| 453 boilerplate_map, HObjectAccess::ForMapInstanceSize()); |
| 453 HValue* size_in_words = Add<HConstant>(size >> kPointerSizeLog2); | 454 HValue* size_in_words = Add<HConstant>(size >> kPointerSizeLog2); |
| 454 checker.If<HCompareNumericAndBranch>(boilerplate_size, | 455 checker.If<HCompareNumericAndBranch>(boilerplate_size, |
| 455 size_in_words, Token::EQ); | 456 size_in_words, Token::EQ); |
| 456 checker.Then(); | 457 checker.Then(); |
| 457 | 458 |
| 458 HValue* size_in_bytes = Add<HConstant>(size); | 459 HValue* size_in_bytes = Add<HConstant>(size); |
| 459 | 460 |
| 460 HInstruction* object = Add<HAllocate>(size_in_bytes, HType::JSObject(), | 461 HInstruction* object = Add<HAllocate>(size_in_bytes, HType::JSObject(), |
| 461 isolate()->heap()->GetPretenureMode(), JS_OBJECT_TYPE); | 462 isolate()->heap()->GetPretenureMode(), JS_OBJECT_TYPE); |
| 462 | 463 |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 return js_function; | 1137 return js_function; |
| 1137 } | 1138 } |
| 1138 | 1139 |
| 1139 | 1140 |
| 1140 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { | 1141 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { |
| 1141 return DoGenerateCode(isolate, this); | 1142 return DoGenerateCode(isolate, this); |
| 1142 } | 1143 } |
| 1143 | 1144 |
| 1144 | 1145 |
| 1145 } } // namespace v8::internal | 1146 } } // namespace v8::internal |
| OLD | NEW |