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

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

Issue 1316943002: Move (uppercase) JS builtins from js builtins object to native context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove Isolate::js_builtins_object Created 5 years, 3 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 int locals_count = info->scope()->num_stack_slots(); 154 int locals_count = info->scope()->num_stack_slots();
155 // Generators allocate locals, if any, in context slots. 155 // Generators allocate locals, if any, in context slots.
156 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); 156 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
157 if (locals_count > 0) { 157 if (locals_count > 0) {
158 if (locals_count >= 128) { 158 if (locals_count >= 128) {
159 Label ok; 159 Label ok;
160 __ Add(ip, sp, -(locals_count * kPointerSize), r0); 160 __ Add(ip, sp, -(locals_count * kPointerSize), r0);
161 __ LoadRoot(r5, Heap::kRealStackLimitRootIndex); 161 __ LoadRoot(r5, Heap::kRealStackLimitRootIndex);
162 __ cmpl(ip, r5); 162 __ cmpl(ip, r5);
163 __ bc_short(ge, &ok); 163 __ bc_short(ge, &ok);
164 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); 164 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION);
165 __ bind(&ok); 165 __ bind(&ok);
166 } 166 }
167 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); 167 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
168 int kMaxPushes = FLAG_optimize_for_size ? 4 : 32; 168 int kMaxPushes = FLAG_optimize_for_size ? 4 : 32;
169 if (locals_count >= kMaxPushes) { 169 if (locals_count >= kMaxPushes) {
170 int loop_iterations = locals_count / kMaxPushes; 170 int loop_iterations = locals_count / kMaxPushes;
171 __ mov(r5, Operand(loop_iterations)); 171 __ mov(r5, Operand(loop_iterations));
172 __ mtctr(r5); 172 __ mtctr(r5);
173 Label loop_header; 173 Label loop_header;
174 __ bind(&loop_header); 174 __ bind(&loop_header);
(...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1861 __ Drop(1); // literal index 1861 __ Drop(1); // literal index
1862 __ Pop(r3); 1862 __ Pop(r3);
1863 result_saved = false; 1863 result_saved = false;
1864 } 1864 }
1865 for (; array_index < length; array_index++) { 1865 for (; array_index < length; array_index++) {
1866 Expression* subexpr = subexprs->at(array_index); 1866 Expression* subexpr = subexprs->at(array_index);
1867 1867
1868 __ Push(r3); 1868 __ Push(r3);
1869 if (subexpr->IsSpread()) { 1869 if (subexpr->IsSpread()) {
1870 VisitForStackValue(subexpr->AsSpread()->expression()); 1870 VisitForStackValue(subexpr->AsSpread()->expression());
1871 __ InvokeBuiltin(Builtins::CONCAT_ITERABLE_TO_ARRAY, CALL_FUNCTION); 1871 __ InvokeBuiltin(Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX,
1872 CALL_FUNCTION);
1872 } else { 1873 } else {
1873 VisitForStackValue(subexpr); 1874 VisitForStackValue(subexpr);
1874 __ CallRuntime(Runtime::kAppendElement, 2); 1875 __ CallRuntime(Runtime::kAppendElement, 2);
1875 } 1876 }
1876 1877
1877 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); 1878 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS);
1878 } 1879 }
1879 1880
1880 if (result_saved) { 1881 if (result_saved) {
1881 __ Drop(1); // literal index 1882 __ Drop(1); // literal index
(...skipping 3178 matching lines...) Expand 10 before | Expand all | Expand 10 after
5060 Label* if_false = NULL; 5061 Label* if_false = NULL;
5061 Label* fall_through = NULL; 5062 Label* fall_through = NULL;
5062 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, 5063 context()->PrepareTest(&materialize_true, &materialize_false, &if_true,
5063 &if_false, &fall_through); 5064 &if_false, &fall_through);
5064 5065
5065 Token::Value op = expr->op(); 5066 Token::Value op = expr->op();
5066 VisitForStackValue(expr->left()); 5067 VisitForStackValue(expr->left());
5067 switch (op) { 5068 switch (op) {
5068 case Token::IN: 5069 case Token::IN:
5069 VisitForStackValue(expr->right()); 5070 VisitForStackValue(expr->right());
5070 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); 5071 __ InvokeBuiltin(Context::IN_BUILTIN_INDEX, CALL_FUNCTION);
5071 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); 5072 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL);
5072 __ LoadRoot(ip, Heap::kTrueValueRootIndex); 5073 __ LoadRoot(ip, Heap::kTrueValueRootIndex);
5073 __ cmp(r3, ip); 5074 __ cmp(r3, ip);
5074 Split(eq, if_true, if_false, fall_through); 5075 Split(eq, if_true, if_false, fall_through);
5075 break; 5076 break;
5076 5077
5077 case Token::INSTANCEOF: { 5078 case Token::INSTANCEOF: {
5078 VisitForStackValue(expr->right()); 5079 VisitForStackValue(expr->right());
5079 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); 5080 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags);
5080 __ CallStub(&stub); 5081 __ CallStub(&stub);
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
5324 return ON_STACK_REPLACEMENT; 5325 return ON_STACK_REPLACEMENT;
5325 } 5326 }
5326 5327
5327 DCHECK(interrupt_address == 5328 DCHECK(interrupt_address ==
5328 isolate->builtins()->OsrAfterStackCheck()->entry()); 5329 isolate->builtins()->OsrAfterStackCheck()->entry());
5329 return OSR_AFTER_STACK_CHECK; 5330 return OSR_AFTER_STACK_CHECK;
5330 } 5331 }
5331 } // namespace internal 5332 } // namespace internal
5332 } // namespace v8 5333 } // namespace v8
5333 #endif // V8_TARGET_ARCH_PPC 5334 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698