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

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

Issue 8111006: Allow new-space JSFunction objects as constant-function properties. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 } 400 }
401 401
402 402
403 void MacroAssembler::StoreRoot(Register source, 403 void MacroAssembler::StoreRoot(Register source,
404 Heap::RootListIndex index, 404 Heap::RootListIndex index,
405 Condition cond) { 405 Condition cond) {
406 str(source, MemOperand(roots, index << kPointerSizeLog2), cond); 406 str(source, MemOperand(roots, index << kPointerSizeLog2), cond);
407 } 407 }
408 408
409 409
410 void MacroAssembler::LoadHeapObject(Register result,
411 Handle<HeapObject> object) {
412 if (isolate()->heap()->InNewSpace(*object)) {
413 Handle<JSGlobalPropertyCell> cell =
414 isolate()->factory()->NewJSGlobalPropertyCell(object);
415 mov(result, Operand(cell));
416 ldr(result, FieldMemOperand(result, JSGlobalPropertyCell::kValueOffset));
417 } else {
418 mov(result, Operand(object));
419 }
420 }
421
422
410 void MacroAssembler::InNewSpace(Register object, 423 void MacroAssembler::InNewSpace(Register object,
411 Register scratch, 424 Register scratch,
412 Condition cond, 425 Condition cond,
413 Label* branch) { 426 Label* branch) {
414 ASSERT(cond == eq || cond == ne); 427 ASSERT(cond == eq || cond == ne);
415 and_(scratch, object, Operand(ExternalReference::new_space_mask(isolate()))); 428 and_(scratch, object, Operand(ExternalReference::new_space_mask(isolate())));
416 cmp(scratch, Operand(ExternalReference::new_space_start(isolate()))); 429 cmp(scratch, Operand(ExternalReference::new_space_start(isolate())));
417 b(cond, branch); 430 b(cond, branch);
418 } 431 }
419 432
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 void MacroAssembler::InvokeFunction(JSFunction* function, 1110 void MacroAssembler::InvokeFunction(JSFunction* function,
1098 const ParameterCount& actual, 1111 const ParameterCount& actual,
1099 InvokeFlag flag, 1112 InvokeFlag flag,
1100 CallKind call_kind) { 1113 CallKind call_kind) {
1101 // You can't call a function without a valid frame. 1114 // You can't call a function without a valid frame.
1102 ASSERT(flag == JUMP_FUNCTION || has_frame()); 1115 ASSERT(flag == JUMP_FUNCTION || has_frame());
1103 1116
1104 ASSERT(function->is_compiled()); 1117 ASSERT(function->is_compiled());
1105 1118
1106 // Get the function and setup the context. 1119 // Get the function and setup the context.
1107 mov(r1, Operand(Handle<JSFunction>(function))); 1120 LoadHeapObject(r1, Handle<JSFunction>(function));
Vyacheslav Egorov (Chromium) 2011/10/12 12:36:05 Some callers of InvokeFunction are not handlified
1108 ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); 1121 ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
1109 1122
1110 // Invoke the cached code. 1123 // Invoke the cached code.
1111 Handle<Code> code(function->code()); 1124 Handle<Code> code(function->code());
1112 ParameterCount expected(function->shared()->formal_parameter_count()); 1125 ParameterCount expected(function->shared()->formal_parameter_count());
1113 if (V8::UseCrankshaft()) { 1126 if (V8::UseCrankshaft()) {
1114 // TODO(kasperl): For now, we always call indirectly through the 1127 // TODO(kasperl): For now, we always call indirectly through the
1115 // code field in the function to allow recompilation to take effect 1128 // code field in the function to allow recompilation to take effect
1116 // without changing any of the call sites. 1129 // without changing any of the call sites.
1117 ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); 1130 ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
(...skipping 2533 matching lines...) Expand 10 before | Expand all | Expand 10 after
3651 void CodePatcher::EmitCondition(Condition cond) { 3664 void CodePatcher::EmitCondition(Condition cond) {
3652 Instr instr = Assembler::instr_at(masm_.pc_); 3665 Instr instr = Assembler::instr_at(masm_.pc_);
3653 instr = (instr & ~kCondMask) | cond; 3666 instr = (instr & ~kCondMask) | cond;
3654 masm_.emit(instr); 3667 masm_.emit(instr);
3655 } 3668 }
3656 3669
3657 3670
3658 } } // namespace v8::internal 3671 } } // namespace v8::internal
3659 3672
3660 #endif // V8_TARGET_ARCH_ARM 3673 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698