Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/compiler/code-stub-assembler.h" | 10 #include "src/compiler/code-stub-assembler.h" |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 465 void StringLengthStub::GenerateAssembly( | 465 void StringLengthStub::GenerateAssembly( |
| 466 compiler::CodeStubAssembler* assembler) const { | 466 compiler::CodeStubAssembler* assembler) const { |
| 467 compiler::Node* value = assembler->Parameter(0); | 467 compiler::Node* value = assembler->Parameter(0); |
| 468 compiler::Node* string = | 468 compiler::Node* string = |
| 469 assembler->LoadObjectField(value, JSValue::kValueOffset); | 469 assembler->LoadObjectField(value, JSValue::kValueOffset); |
| 470 compiler::Node* result = | 470 compiler::Node* result = |
| 471 assembler->LoadObjectField(string, String::kLengthOffset); | 471 assembler->LoadObjectField(string, String::kLengthOffset); |
| 472 assembler->Return(result); | 472 assembler->Return(result); |
| 473 } | 473 } |
| 474 | 474 |
| 475 void AllocateHeapNumberStub::GenerateAssembly( | |
| 476 compiler::CodeStubAssembler* assembler) const { | |
| 477 compiler::Node* result = assembler->Allocate( | |
| 478 HeapNumber::kSize, compiler::AllocationFlags::kTagObject); | |
| 479 | |
| 480 assembler->StoreNoWriteBarrier( | |
| 481 MachineRepresentation::kTagged, | |
| 482 assembler->IntPtrAdd( | |
|
Benedikt Meurer
2016/02/25 13:00:40
Please don't nest these computations, add separate
epertoso
2016/02/25 13:26:53
Done.
| |
| 483 result, | |
| 484 assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag)), | |
| 485 assembler->HeapConstant(isolate()->factory()->heap_number_map())); | |
| 486 assembler->Return(result); | |
| 487 } | |
| 488 | |
| 489 void AllocateMutableHeapNumberStub::GenerateAssembly( | |
| 490 compiler::CodeStubAssembler* assembler) const { | |
| 491 compiler::Node* result = assembler->Allocate( | |
| 492 HeapNumber::kSize, compiler::AllocationFlags::kTagObject); | |
| 493 assembler->StoreNoWriteBarrier( | |
|
Benedikt Meurer
2016/02/25 13:00:40
Same here.
epertoso
2016/02/25 13:26:53
Done.
| |
| 494 MachineRepresentation::kTagged, | |
| 495 assembler->IntPtrAdd( | |
| 496 result, | |
| 497 assembler->IntPtrConstant(HeapObject::kMapOffset - kHeapObjectTag)), | |
| 498 assembler->HeapConstant(isolate()->factory()->mutable_heap_number_map())); | |
| 499 assembler->Return(result); | |
| 500 } | |
| 475 | 501 |
| 476 template<class StateType> | 502 template<class StateType> |
| 477 void HydrogenCodeStub::TraceTransition(StateType from, StateType to) { | 503 void HydrogenCodeStub::TraceTransition(StateType from, StateType to) { |
| 478 // Note: Although a no-op transition is semantically OK, it is hinting at a | 504 // Note: Although a no-op transition is semantically OK, it is hinting at a |
| 479 // bug somewhere in our state transition machinery. | 505 // bug somewhere in our state transition machinery. |
| 480 DCHECK(from != to); | 506 DCHECK(from != to); |
| 481 if (!FLAG_trace_ic) return; | 507 if (!FLAG_trace_ic) return; |
| 482 OFStream os(stdout); | 508 OFStream os(stdout); |
| 483 os << "["; | 509 os << "["; |
| 484 PrintBaseName(os); | 510 PrintBaseName(os); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 907 if (type->Is(Type::UntaggedPointer())) { | 933 if (type->Is(Type::UntaggedPointer())) { |
| 908 return Representation::External(); | 934 return Representation::External(); |
| 909 } | 935 } |
| 910 | 936 |
| 911 DCHECK(!type->Is(Type::Untagged())); | 937 DCHECK(!type->Is(Type::Untagged())); |
| 912 return Representation::Tagged(); | 938 return Representation::Tagged(); |
| 913 } | 939 } |
| 914 | 940 |
| 915 } // namespace internal | 941 } // namespace internal |
| 916 } // namespace v8 | 942 } // namespace v8 |
| OLD | NEW |