Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(556)

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 9265007: MIPS: Make sure transitioned arrays efficiently call builtin Array functions (Closed)
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 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
11 // with the distribution. 11 // with the distribution.
(...skipping 3294 matching lines...) Expand 10 before | Expand all | Expand 10 after
3306 CpuFeatures::Scope scope(FPU); 3306 CpuFeatures::Scope scope(FPU);
3307 sdc1(f0, MemOperand(scratch1, 0)); 3307 sdc1(f0, MemOperand(scratch1, 0));
3308 } else { 3308 } else {
3309 sw(mantissa_reg, MemOperand(scratch1, 0)); 3309 sw(mantissa_reg, MemOperand(scratch1, 0));
3310 sw(exponent_reg, MemOperand(scratch1, Register::kSizeInBytes)); 3310 sw(exponent_reg, MemOperand(scratch1, Register::kSizeInBytes));
3311 } 3311 }
3312 bind(&done); 3312 bind(&done);
3313 } 3313 }
3314 3314
3315 3315
3316 void MacroAssembler::CompareMapAndBranch(Register obj,
3317 Register scratch,
3318 Handle<Map> map,
3319 Label* early_success,
3320 Condition cond,
3321 Label* branch_to,
3322 CompareMapMode mode) {
3323 lw(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
3324 Operand right = Operand(map);
3325 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) {
3326 Map* transitioned_fast_element_map(
3327 map->LookupElementsTransitionMap(FAST_ELEMENTS, NULL));
3328 ASSERT(transitioned_fast_element_map == NULL ||
3329 map->elements_kind() != FAST_ELEMENTS);
3330 if (transitioned_fast_element_map != NULL) {
3331 Branch(early_success, eq, scratch, right);
3332 right = Operand(Handle<Map>(transitioned_fast_element_map));
3333 }
3334
3335 Map* transitioned_double_map(
3336 map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, NULL));
3337 ASSERT(transitioned_double_map == NULL ||
3338 map->elements_kind() == FAST_SMI_ONLY_ELEMENTS);
3339 if (transitioned_double_map != NULL) {
3340 Branch(early_success, eq, scratch, right);
3341 right = Operand(Handle<Map>(transitioned_double_map));
3342 }
3343 }
3344
3345 Branch(branch_to, cond, scratch, right);
3346 }
3347
3348
3316 void MacroAssembler::CheckMap(Register obj, 3349 void MacroAssembler::CheckMap(Register obj,
3317 Register scratch, 3350 Register scratch,
3318 Handle<Map> map, 3351 Handle<Map> map,
3319 Label* fail, 3352 Label* fail,
3320 SmiCheckType smi_check_type) { 3353 SmiCheckType smi_check_type,
3354 CompareMapMode mode) {
3321 if (smi_check_type == DO_SMI_CHECK) { 3355 if (smi_check_type == DO_SMI_CHECK) {
3322 JumpIfSmi(obj, fail); 3356 JumpIfSmi(obj, fail);
3323 } 3357 }
3324 lw(scratch, FieldMemOperand(obj, HeapObject::kMapOffset)); 3358 Label success;
3325 li(at, Operand(map)); 3359 CompareMapAndBranch(obj, scratch, map, &success, ne, fail, mode);
3326 Branch(fail, ne, scratch, Operand(at)); 3360 bind(&success);
3327 } 3361 }
3328 3362
3329 3363
3330 void MacroAssembler::DispatchMap(Register obj, 3364 void MacroAssembler::DispatchMap(Register obj,
3331 Register scratch, 3365 Register scratch,
3332 Handle<Map> map, 3366 Handle<Map> map,
3333 Handle<Code> success, 3367 Handle<Code> success,
3334 SmiCheckType smi_check_type) { 3368 SmiCheckType smi_check_type) {
3335 Label fail; 3369 Label fail;
3336 if (smi_check_type == DO_SMI_CHECK) { 3370 if (smi_check_type == DO_SMI_CHECK) {
(...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after
5045 opcode == BGTZL); 5079 opcode == BGTZL);
5046 opcode = (cond == eq) ? BEQ : BNE; 5080 opcode = (cond == eq) ? BEQ : BNE;
5047 instr = (instr & ~kOpcodeMask) | opcode; 5081 instr = (instr & ~kOpcodeMask) | opcode;
5048 masm_.emit(instr); 5082 masm_.emit(instr);
5049 } 5083 }
5050 5084
5051 5085
5052 } } // namespace v8::internal 5086 } } // namespace v8::internal
5053 5087
5054 #endif // V8_TARGET_ARCH_MIPS 5088 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698