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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) { | 401 Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) { |
402 if (op->IsRegister()) { | 402 if (op->IsRegister()) { |
403 return ToRegister(op->index()); | 403 return ToRegister(op->index()); |
404 } else if (op->IsConstantOperand()) { | 404 } else if (op->IsConstantOperand()) { |
405 LConstantOperand* const_op = LConstantOperand::cast(op); | 405 LConstantOperand* const_op = LConstantOperand::cast(op); |
406 HConstant* constant = chunk_->LookupConstant(const_op); | 406 HConstant* constant = chunk_->LookupConstant(const_op); |
407 Handle<Object> literal = constant->handle(isolate()); | 407 Handle<Object> literal = constant->handle(isolate()); |
408 Representation r = chunk_->LookupLiteralRepresentation(const_op); | 408 Representation r = chunk_->LookupLiteralRepresentation(const_op); |
409 if (r.IsInteger32()) { | 409 if (r.IsInteger32()) { |
| 410 AllowDeferredHandleDereference get_number; |
410 DCHECK(literal->IsNumber()); | 411 DCHECK(literal->IsNumber()); |
411 __ li(scratch, Operand(static_cast<int32_t>(literal->Number()))); | 412 __ li(scratch, Operand(static_cast<int32_t>(literal->Number()))); |
412 } else if (r.IsSmi()) { | 413 } else if (r.IsSmi()) { |
413 DCHECK(constant->HasSmiValue()); | 414 DCHECK(constant->HasSmiValue()); |
414 __ li(scratch, Operand(Smi::FromInt(constant->Integer32Value()))); | 415 __ li(scratch, Operand(Smi::FromInt(constant->Integer32Value()))); |
415 } else if (r.IsDouble()) { | 416 } else if (r.IsDouble()) { |
416 Abort(kEmitLoadRegisterUnsupportedDoubleImmediate); | 417 Abort(kEmitLoadRegisterUnsupportedDoubleImmediate); |
417 } else { | 418 } else { |
418 DCHECK(r.IsSmiOrTagged()); | 419 DCHECK(r.IsSmiOrTagged()); |
419 __ li(scratch, literal); | 420 __ li(scratch, literal); |
(...skipping 5790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6210 __ Push(at, ToRegister(instr->function())); | 6211 __ Push(at, ToRegister(instr->function())); |
6211 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6212 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6212 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6213 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6213 } | 6214 } |
6214 | 6215 |
6215 | 6216 |
6216 #undef __ | 6217 #undef __ |
6217 | 6218 |
6218 } // namespace internal | 6219 } // namespace internal |
6219 } // namespace v8 | 6220 } // namespace v8 |
OLD | NEW |