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

Side by Side Diff: src/x64/full-codegen-x64.cc

Issue 12296026: ES6 symbols: Implement Symbol intrinsic and basic functionality (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed more comments Created 7 years, 9 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
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/lithium-codegen-x64.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 2012 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
(...skipping 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after
2653 // default valueOf and set true result. 2653 // default valueOf and set true result.
2654 __ or_(FieldOperand(rbx, Map::kBitField2Offset), 2654 __ or_(FieldOperand(rbx, Map::kBitField2Offset),
2655 Immediate(1 << Map::kStringWrapperSafeForDefaultValueOf)); 2655 Immediate(1 << Map::kStringWrapperSafeForDefaultValueOf));
2656 __ jmp(if_true); 2656 __ jmp(if_true);
2657 2657
2658 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 2658 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
2659 context()->Plug(if_true, if_false); 2659 context()->Plug(if_true, if_false);
2660 } 2660 }
2661 2661
2662 2662
2663 void FullCodeGenerator::EmitIsSymbol(CallRuntime* expr) {
2664 ZoneList<Expression*>* args = expr->arguments();
2665 ASSERT(args->length() == 1);
2666
2667 VisitForAccumulatorValue(args->at(0));
2668
2669 Label materialize_true, materialize_false;
2670 Label* if_true = NULL;
2671 Label* if_false = NULL;
2672 Label* fall_through = NULL;
2673 context()->PrepareTest(&materialize_true, &materialize_false,
2674 &if_true, &if_false, &fall_through);
2675
2676 __ JumpIfSmi(rax, if_false);
2677 __ CmpObjectType(rax, SYMBOL_TYPE, rbx);
2678 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
2679 Split(equal, if_true, if_false, fall_through);
2680
2681 context()->Plug(if_true, if_false);
2682 }
2683
2684
2663 void FullCodeGenerator::EmitIsFunction(CallRuntime* expr) { 2685 void FullCodeGenerator::EmitIsFunction(CallRuntime* expr) {
2664 ZoneList<Expression*>* args = expr->arguments(); 2686 ZoneList<Expression*>* args = expr->arguments();
2665 ASSERT(args->length() == 1); 2687 ASSERT(args->length() == 1);
2666 2688
2667 VisitForAccumulatorValue(args->at(0)); 2689 VisitForAccumulatorValue(args->at(0));
2668 2690
2669 Label materialize_true, materialize_false; 2691 Label materialize_true, materialize_false;
2670 Label* if_true = NULL; 2692 Label* if_true = NULL;
2671 Label* if_false = NULL; 2693 Label* if_false = NULL;
2672 Label* fall_through = NULL; 2694 Label* fall_through = NULL;
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after
4252 __ CmpObjectType(rax, JS_FUNCTION_TYPE, rdx); 4274 __ CmpObjectType(rax, JS_FUNCTION_TYPE, rdx);
4253 __ j(equal, if_true); 4275 __ j(equal, if_true);
4254 __ CmpInstanceType(rdx, JS_FUNCTION_PROXY_TYPE); 4276 __ CmpInstanceType(rdx, JS_FUNCTION_PROXY_TYPE);
4255 Split(equal, if_true, if_false, fall_through); 4277 Split(equal, if_true, if_false, fall_through);
4256 } else if (check->Equals(isolate()->heap()->object_string())) { 4278 } else if (check->Equals(isolate()->heap()->object_string())) {
4257 __ JumpIfSmi(rax, if_false); 4279 __ JumpIfSmi(rax, if_false);
4258 if (!FLAG_harmony_typeof) { 4280 if (!FLAG_harmony_typeof) {
4259 __ CompareRoot(rax, Heap::kNullValueRootIndex); 4281 __ CompareRoot(rax, Heap::kNullValueRootIndex);
4260 __ j(equal, if_true); 4282 __ j(equal, if_true);
4261 } 4283 }
4284 if (FLAG_harmony_symbols) {
4285 __ CmpObjectType(rax, SYMBOL_TYPE, rdx);
4286 __ j(equal, if_true);
4287 }
4262 __ CmpObjectType(rax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, rdx); 4288 __ CmpObjectType(rax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, rdx);
4263 __ j(below, if_false); 4289 __ j(below, if_false);
4264 __ CmpInstanceType(rdx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 4290 __ CmpInstanceType(rdx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE);
4265 __ j(above, if_false); 4291 __ j(above, if_false);
4266 // Check for undetectable objects => false. 4292 // Check for undetectable objects => false.
4267 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), 4293 __ testb(FieldOperand(rdx, Map::kBitFieldOffset),
4268 Immediate(1 << Map::kIsUndetectable)); 4294 Immediate(1 << Map::kIsUndetectable));
4269 Split(zero, if_true, if_false, fall_through); 4295 Split(zero, if_true, if_false, fall_through);
4270 } else { 4296 } else {
4271 if (if_false != fall_through) __ jmp(if_false); 4297 if (if_false != fall_through) __ jmp(if_false);
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
4526 *context_length = 0; 4552 *context_length = 0;
4527 return previous_; 4553 return previous_;
4528 } 4554 }
4529 4555
4530 4556
4531 #undef __ 4557 #undef __
4532 4558
4533 } } // namespace v8::internal 4559 } } // namespace v8::internal
4534 4560
4535 #endif // V8_TARGET_ARCH_X64 4561 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698