| 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 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
| 8 | 8 |
| 9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
| 10 // | 10 // |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 cp, target.offset(), a0, a3, kRAHasBeenSaved, kDontSaveFPRegs); | 238 cp, target.offset(), a0, a3, kRAHasBeenSaved, kDontSaveFPRegs); |
| 239 } else if (FLAG_debug_code) { | 239 } else if (FLAG_debug_code) { |
| 240 Label done; | 240 Label done; |
| 241 __ JumpIfInNewSpace(cp, a0, &done); | 241 __ JumpIfInNewSpace(cp, a0, &done); |
| 242 __ Abort(kExpectedNewSpaceObject); | 242 __ Abort(kExpectedNewSpaceObject); |
| 243 __ bind(&done); | 243 __ bind(&done); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 |
| 249 // Possibly allocate RestParameters |
| 250 int rest_index; |
| 251 Variable* rest_param = scope()->rest_parameter(&rest_index); |
| 252 if (rest_param) { |
| 253 Comment cmnt(masm_, "[ Allocate rest parameter array"); |
| 254 |
| 255 int num_parameters = info->scope()->num_parameters(); |
| 256 int offset = num_parameters * kPointerSize; |
| 257 __ Daddu(a3, fp, |
| 258 Operand(StandardFrameConstants::kCallerSPOffset + offset)); |
| 259 __ li(a2, Operand(Smi::FromInt(num_parameters))); |
| 260 __ li(a1, Operand(Smi::FromInt(rest_index))); |
| 261 __ Push(a3, a2, a1); |
| 262 |
| 263 RestParamAccessStub stub(isolate()); |
| 264 __ CallStub(&stub); |
| 265 |
| 266 SetVar(rest_param, v0, a1, a2); |
| 267 } |
| 268 |
| 248 Variable* arguments = scope()->arguments(); | 269 Variable* arguments = scope()->arguments(); |
| 249 if (arguments != NULL) { | 270 if (arguments != NULL) { |
| 250 // Function uses arguments object. | 271 // Function uses arguments object. |
| 251 Comment cmnt(masm_, "[ Allocate arguments object"); | 272 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 252 if (!function_in_register) { | 273 if (!function_in_register) { |
| 253 // Load this again, if it's used by the local context below. | 274 // Load this again, if it's used by the local context below. |
| 254 __ ld(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 275 __ ld(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 255 } else { | 276 } else { |
| 256 __ mov(a3, a1); | 277 __ mov(a3, a1); |
| 257 } | 278 } |
| 258 // Receiver is just before the parameters on the caller's stack. | 279 // Receiver is just before the parameters on the caller's stack. |
| 259 int num_parameters = info->scope()->num_parameters(); | 280 int num_parameters = info->scope()->num_parameters(); |
| 260 int offset = num_parameters * kPointerSize; | 281 int offset = num_parameters * kPointerSize; |
| 261 __ Daddu(a2, fp, | 282 __ Daddu(a2, fp, |
| 262 Operand(StandardFrameConstants::kCallerSPOffset + offset)); | 283 Operand(StandardFrameConstants::kCallerSPOffset + offset)); |
| 263 __ li(a1, Operand(Smi::FromInt(num_parameters))); | 284 __ li(a1, Operand(Smi::FromInt(num_parameters))); |
| 264 __ Push(a3, a2, a1); | 285 __ Push(a3, a2, a1); |
| 265 | 286 |
| 266 // Arguments to ArgumentsAccessStub: | 287 // Arguments to ArgumentsAccessStub: |
| 267 // function, receiver address, parameter count. | 288 // function, receiver address, parameter count. |
| 268 // The stub will rewrite receiever and parameter count if the previous | 289 // The stub will rewrite receiever and parameter count if the previous |
| 269 // stack frame was an arguments adapter frame. | 290 // stack frame was an arguments adapter frame. |
| 270 ArgumentsAccessStub::Type type; | 291 ArgumentsAccessStub::Type type; |
| 271 if (is_strict(language_mode())) { | 292 if (is_strict(language_mode()) || !is_simple_parameter_list()) { |
| 272 type = ArgumentsAccessStub::NEW_STRICT; | 293 type = ArgumentsAccessStub::NEW_STRICT; |
| 273 } else if (function()->has_duplicate_parameters()) { | 294 } else if (function()->has_duplicate_parameters()) { |
| 274 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; | 295 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; |
| 275 } else { | 296 } else { |
| 276 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; | 297 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; |
| 277 } | 298 } |
| 278 ArgumentsAccessStub stub(isolate(), type); | 299 ArgumentsAccessStub stub(isolate(), type); |
| 279 __ CallStub(&stub); | 300 __ CallStub(&stub); |
| 280 | 301 |
| 281 SetVar(arguments, v0, a1, a2); | 302 SetVar(arguments, v0, a1, a2); |
| (...skipping 5086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5368 Assembler::target_address_at(pc_immediate_load_address)) == | 5389 Assembler::target_address_at(pc_immediate_load_address)) == |
| 5369 reinterpret_cast<uint64_t>( | 5390 reinterpret_cast<uint64_t>( |
| 5370 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5391 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5371 return OSR_AFTER_STACK_CHECK; | 5392 return OSR_AFTER_STACK_CHECK; |
| 5372 } | 5393 } |
| 5373 | 5394 |
| 5374 | 5395 |
| 5375 } } // namespace v8::internal | 5396 } } // namespace v8::internal |
| 5376 | 5397 |
| 5377 #endif // V8_TARGET_ARCH_MIPS64 | 5398 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |