| 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 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| 11 // parameter to a function is defined to be 'a0'. So there are many | 11 // parameter to a function is defined to be 'a0'. So there are many |
| 12 // places where we have to move a previous result in v0 to a0 for the | 12 // places where we have to move a previous result in v0 to a0 for the |
| 13 // next call: mov(a0, v0). This is not needed on the other architectures. | 13 // next call: mov(a0, v0). This is not needed on the other architectures. |
| 14 | 14 |
| 15 #include "src/full-codegen/full-codegen.h" | |
| 16 #include "src/ast/compile-time-value.h" | 15 #include "src/ast/compile-time-value.h" |
| 17 #include "src/ast/scopes.h" | 16 #include "src/ast/scopes.h" |
| 17 #include "src/builtins/builtins-constructor.h" |
| 18 #include "src/code-factory.h" | 18 #include "src/code-factory.h" |
| 19 #include "src/code-stubs.h" | 19 #include "src/code-stubs.h" |
| 20 #include "src/codegen.h" | 20 #include "src/codegen.h" |
| 21 #include "src/compilation-info.h" | 21 #include "src/compilation-info.h" |
| 22 #include "src/compiler.h" | 22 #include "src/compiler.h" |
| 23 #include "src/debug/debug.h" | 23 #include "src/debug/debug.h" |
| 24 #include "src/full-codegen/full-codegen.h" |
| 24 #include "src/ic/ic.h" | 25 #include "src/ic/ic.h" |
| 25 | 26 |
| 26 #include "src/mips/code-stubs-mips.h" | 27 #include "src/mips/code-stubs-mips.h" |
| 27 #include "src/mips/macro-assembler-mips.h" | 28 #include "src/mips/macro-assembler-mips.h" |
| 28 | 29 |
| 29 namespace v8 { | 30 namespace v8 { |
| 30 namespace internal { | 31 namespace internal { |
| 31 | 32 |
| 32 #define __ ACCESS_MASM(masm()) | 33 #define __ ACCESS_MASM(masm()) |
| 33 | 34 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 __ Push(info->scope()->scope_info()); | 202 __ Push(info->scope()->scope_info()); |
| 202 __ CallRuntime(Runtime::kNewScriptContext); | 203 __ CallRuntime(Runtime::kNewScriptContext); |
| 203 PrepareForBailoutForId(BailoutId::ScriptContext(), | 204 PrepareForBailoutForId(BailoutId::ScriptContext(), |
| 204 BailoutState::TOS_REGISTER); | 205 BailoutState::TOS_REGISTER); |
| 205 // The new target value is not used, clobbering is safe. | 206 // The new target value is not used, clobbering is safe. |
| 206 DCHECK_NULL(info->scope()->new_target_var()); | 207 DCHECK_NULL(info->scope()->new_target_var()); |
| 207 } else { | 208 } else { |
| 208 if (info->scope()->new_target_var() != nullptr) { | 209 if (info->scope()->new_target_var() != nullptr) { |
| 209 __ push(a3); // Preserve new target. | 210 __ push(a3); // Preserve new target. |
| 210 } | 211 } |
| 211 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { | 212 if (slots <= |
| 212 FastNewFunctionContextStub stub(isolate(), info->scope()->scope_type()); | 213 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { |
| 214 Callable callable = CodeFactory::FastNewFunctionContext( |
| 215 isolate(), info->scope()->scope_type()); |
| 213 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), | 216 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), |
| 214 Operand(slots)); | 217 Operand(slots)); |
| 215 __ CallStub(&stub); | 218 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
| 216 // Result of FastNewFunctionContextStub is always in new space. | 219 // Result of the FastNewFunctionContext builtin is always in new space. |
| 217 need_write_barrier = false; | 220 need_write_barrier = false; |
| 218 } else { | 221 } else { |
| 219 __ push(a1); | 222 __ push(a1); |
| 220 __ Push(Smi::FromInt(info->scope()->scope_type())); | 223 __ Push(Smi::FromInt(info->scope()->scope_type())); |
| 221 __ CallRuntime(Runtime::kNewFunctionContext); | 224 __ CallRuntime(Runtime::kNewFunctionContext); |
| 222 } | 225 } |
| 223 if (info->scope()->new_target_var() != nullptr) { | 226 if (info->scope()->new_target_var() != nullptr) { |
| 224 __ pop(a3); // Restore new target. | 227 __ pop(a3); // Restore new target. |
| 225 } | 228 } |
| 226 } | 229 } |
| (...skipping 2651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2878 reinterpret_cast<uint32_t>( | 2881 reinterpret_cast<uint32_t>( |
| 2879 isolate->builtins()->OnStackReplacement()->entry())); | 2882 isolate->builtins()->OnStackReplacement()->entry())); |
| 2880 return ON_STACK_REPLACEMENT; | 2883 return ON_STACK_REPLACEMENT; |
| 2881 } | 2884 } |
| 2882 | 2885 |
| 2883 | 2886 |
| 2884 } // namespace internal | 2887 } // namespace internal |
| 2885 } // namespace v8 | 2888 } // namespace v8 |
| 2886 | 2889 |
| 2887 #endif // V8_TARGET_ARCH_MIPS | 2890 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |